freqtrade/freqtrade

View on GitHub

Showing 515 of 517 total issues

Function get_markets has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def get_markets(
        self,
        base_currencies: Optional[List[str]] = None,
        quote_currencies: Optional[List[str]] = None,
        spot_only: bool = False,
Severity: Minor
Found in freqtrade/exchange/exchange.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

Avoid deeply nested control flow statements.
Open

                        if pair_fees.get(takerOrMaker) is not None:
                            trades[idx]["fee"] = {
                                "currency": self.get_pair_quote_currency(pair),
                                "cost": trade["cost"] * pair_fees[takerOrMaker],
                                "rate": pair_fees[takerOrMaker],
Severity: Major
Found in freqtrade/exchange/gate.py - About 45 mins to fix

    Function check_conflicting_settings has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def check_conflicting_settings(
        config: Config,
        section_old: Optional[str],
        name_old: str,
        section_new: Optional[str],
    Severity: Minor
    Found in freqtrade/configuration/deprecated_settings.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

    Consider simplifying this complex logical expression.
    Open

                if (
                    not self.strategy.use_custom_stoploss
                    and self.strategy.trailing_stop
                    and self.strategy.trailing_only_offset_is_reached
                    and self.strategy.trailing_stop_positive_offset is not None
    Severity: Major
    Found in freqtrade/optimize/backtesting.py - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (
                  (self._position_stacking or len(LocalTrade.bt_trades_open_pp[pair]) == 0)
                  and is_first
                  and current_time != end_date
                  and trade_dir is not None
      Severity: Major
      Found in freqtrade/optimize/backtesting.py - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if PairLocks.use_db:
                    return PairLock.query_pair_locks(pair, now, side).all()
                else:
                    locks = [
                        lock
        Severity: Major
        Found in freqtrade/persistence/pairlock_middleware.py - About 40 mins to fix

          Function __balance_get_est_stake has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __balance_get_est_stake(
          Severity: Minor
          Found in freqtrade/rpc/rpc.py - About 35 mins to fix

            Function _rpc_analysed_dataframe has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _rpc_analysed_dataframe(
            Severity: Minor
            Found in freqtrade/rpc/rpc.py - About 35 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in freqtrade/plugins/pairlist/ShuffleFilter.py - About 35 mins to fix

                Function _rpc_add_lock has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _rpc_add_lock(
                Severity: Minor
                Found in freqtrade/rpc/rpc.py - About 35 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in freqtrade/plugins/pairlist/PerformanceFilter.py - About 35 mins to fix

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

                        def __init__(
                    Severity: Minor
                    Found in freqtrade/plugins/pairlist/AgeFilter.py - About 35 mins to fix

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

                          def __init__(
                      Severity: Minor
                      Found in freqtrade/plugins/pairlist/FullTradesFilter.py - About 35 mins to fix

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

                            def __init__(
                        Severity: Minor
                        Found in freqtrade/plugins/pairlist/OffsetFilter.py - About 35 mins to fix

                          Function is_pair_locked has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def is_pair_locked(
                          Severity: Minor
                          Found in freqtrade/strategy/interface.py - About 35 mins to fix

                            Function assert_df has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def assert_df(self, dataframe: DataFrame, df_len: int, df_close: float, df_date: datetime):
                            Severity: Minor
                            Found in freqtrade/strategy/interface.py - About 35 mins to fix

                              Function _rpc_analysed_history_full has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def _rpc_analysed_history_full(
                              Severity: Minor
                              Found in freqtrade/rpc/rpc.py - About 35 mins to fix

                                Function _call has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def _call(self, method, apipath, params: Optional[dict] = None, data=None, files=None):
                                Severity: Minor
                                Found in ft_client/freqtrade_client/ft_rest_client.py - About 35 mins to fix

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

                                      def __init__(
                                  Severity: Minor
                                  Found in freqtrade/plugins/pairlist/SpreadFilter.py - About 35 mins to fix

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

                                        def __init__(
                                    Severity: Minor
                                    Found in freqtrade/plugins/pairlist/VolumePairList.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language