freqtrade/freqtrade

View on GitHub

Showing 535 of 535 total issues

Function create_order has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def create_order(
Severity: Major
Found in freqtrade/exchange/exchange.py - About 1 hr to fix

    Function load_data has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def load_data(
        datadir: Path,
        timeframe: str,
        pairs: List[str],
        *,
    Severity: Minor
    Found in freqtrade/data/history/history_utils.py - About 1 hr 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 _flat_vars_to_nested_dict has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _flat_vars_to_nested_dict(env_dict: Dict[str, Any], prefix: str) -> Dict[str, Any]:
        """
        Environment variables must be prefixed with FREQTRADE.
        FREQTRADE__{section}__{key}
        :param env_dict: Dictionary to validate - usually os.environ
    Severity: Minor
    Found in freqtrade/configuration/environment_vars.py - About 1 hr 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 11 (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/binance.py - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            config: Config,
            *,
            exchange_config: Optional[ExchangeConfig] = None,
    Severity: Minor
    Found in freqtrade/exchange/exchange.py - About 1 hr 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 _fetch_stop_order_fallback has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def _fetch_stop_order_fallback(self, order_id: str, pair: str) -> Dict:
            params2 = {"stop": True, "ordType": "conditional"}
            for method in (
                self._api.fetch_open_orders,
                self._api.fetch_closed_orders,
    Severity: Minor
    Found in freqtrade/exchange/okx.py - About 1 hr 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 export_csv_file has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def export_csv_file(config: Config, results: list, csv_file: str) -> None:
            """
            Log result to csv-file
            """
            if not results:
    Severity: Minor
    Found in freqtrade/optimize/hyperopt_tools.py - About 1 hr to fix

      Function confirm_trade_entry has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def confirm_trade_entry(
      Severity: Major
      Found in freqtrade/templates/FreqaiExampleStrategy.py - About 1 hr to fix

        Function ft_stoploss_adjust has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def ft_stoploss_adjust(
        Severity: Major
        Found in freqtrade/strategy/interface.py - About 1 hr to fix

          Function leverage has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def leverage(
          Severity: Major
          Found in freqtrade/strategy/interface.py - About 1 hr to fix

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

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

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

                  def __init__(
              Severity: Major
              Found in freqtrade/freqai/torch/PyTorchModelTrainer.py - About 1 hr to fix

                Function _enter_trade has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _enter_trade(
                Severity: Major
                Found in freqtrade/optimize/backtesting.py - About 1 hr to fix

                  Function create_dry_run_order has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def create_dry_run_order(
                  Severity: Major
                  Found in freqtrade/exchange/exchange.py - About 1 hr to fix

                    Function print_results has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def print_results(
                    Severity: Major
                    Found in freqtrade/data/entryexitanalysis.py - About 1 hr to fix

                      Function ohlcv_load has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def ohlcv_load(
                      Severity: Major
                      Found in freqtrade/data/history/datahandlers/idatahandler.py - About 1 hr to fix

                        Function get_valid_enter_price_and_stake has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def get_valid_enter_price_and_stake(
                        Severity: Major
                        Found in freqtrade/freqtradebot.py - About 1 hr to fix

                          Function create_order has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def create_order(
                          Severity: Major
                          Found in freqtrade/exchange/kucoin.py - About 1 hr to fix

                            Function _rpc_balance has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def _rpc_balance(self, stake_currency: str, fiat_display_currency: str) -> Dict:
                                    """Returns current account balance per crypto"""
                                    currencies: List[Dict] = []
                                    total = 0.0
                                    total_bot = 0.0
                            Severity: Minor
                            Found in freqtrade/rpc/rpc.py - About 1 hr to fix

                              Function __balance_get_est_stake has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def __balance_get_est_stake(
                                      self, coin: str, stake_currency: str, amount: float, balance: Wallet, tickers
                                  ) -> Tuple[float, float]:
                                      est_stake = 0.0
                                      est_bot_stake = 0.0
                              Severity: Minor
                              Found in freqtrade/rpc/rpc.py - About 1 hr 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

                              Severity
                              Category
                              Status
                              Source
                              Language