freqtrade/freqtrade

View on GitHub

Showing 502 of 504 total issues

Function _build_coroutine has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _build_coroutine(
Severity: Minor
Found in freqtrade/exchange/exchange.py - About 45 mins to fix

    Function calculate_max_drawdown has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def calculate_max_drawdown(trades: pd.DataFrame, *, date_col: str = 'close_date',
    Severity: Minor
    Found in freqtrade/data/metrics.py - About 45 mins to fix

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

          def get_analyzed_dataframe(self, pair: str, timeframe: str) -> Tuple[DataFrame, datetime]:
              """
              Retrieve the analyzed dataframe. Returns the full dataframe in trade mode (live / dry),
              and the last 1000 candles (up to the time evaluated at this moment) in all other modes.
              :param pair: pair to get the data for
      Severity: Minor
      Found in freqtrade/data/dataprovider.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 calculate_funding_fees has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def calculate_funding_fees(
      Severity: Minor
      Found in freqtrade/exchange/kraken.py - About 45 mins to fix

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

        def validate_config_schema(conf: Dict[str, Any], preliminary: bool = False) -> Dict[str, Any]:
            """
            Validate the configuration follow the Config Schema
            :param conf: Config in JSON format
            :return: Returns the config if valid, otherwise throw an exception
        Severity: Minor
        Found in freqtrade/configuration/config_validation.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], name_new: str) -> None:
              section_new_config = config.get(section_new, {}) if section_new else config
              section_old_config = config.get(section_old, {}) if section_old else config
          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

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

          def sanitize_config(config: Config, *, show_sensitive: bool = False) -> Config:
              """
              Remove sensitive information from the config.
              :param config: Configuration
              :param show_sensitive: Show sensitive information
          Severity: Minor
          Found in freqtrade/configuration/config_secrets.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 __price_to_precision_significant_digits has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def __price_to_precision_significant_digits(
              price: float,
              price_precision: float,
              *,
              rounding_mode: int = ROUND,
          Severity: Minor
          Found in freqtrade/exchange/exchange_utils.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 (
                      (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 (
                            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
                            and self.strategy.trailing_stop_positive
            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 for lock in PairLocks.locks if (
                              lock.lock_end_time >= now
              Severity: Major
              Found in freqtrade/persistence/pairlock_middleware.py - About 40 mins to fix

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

                    def __init__(self, exchange: Exchange, pairlistmanager,
                Severity: Minor
                Found in freqtrade/plugins/pairlist/IPairList.py - About 35 mins to fix

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

                      def __init__(self, exchange, pairlistmanager,
                  Severity: Minor
                  Found in freqtrade/plugins/pairlist/ProducerPairList.py - About 35 mins to fix

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

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

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

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

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

                        def safe_value_fallback2(dict1: dictMap, dict2: dictMap, key1: str, key2: str, default_value=None):
                        Severity: Minor
                        Found in freqtrade/misc.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 lock_pair has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def lock_pair(self, pair: str, until: datetime,
                            Severity: Minor
                            Found in freqtrade/strategy/interface.py - About 35 mins to fix

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

                              def add_profit(fig, row, data: pd.DataFrame, column: str, name: str) -> make_subplots:
                              Severity: Minor
                              Found in freqtrade/plot/plotting.py - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language