freqtrade/freqtrade

View on GitHub

Showing 501 of 503 total issues

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 _download_pair_history has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _download_pair_history(
    pair: str,
    *,
    datadir: Path,
    exchange: Exchange,
Severity: Minor
Found in freqtrade/data/history/history_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

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

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

def print_results(
Severity: Minor
Found in freqtrade/data/entryexitanalysis.py - About 45 mins to fix

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

        def _replace_external_df(
    Severity: Minor
    Found in freqtrade/data/dataprovider.py - About 45 mins to fix

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

          def _check_empty_df(
      Severity: Minor
      Found in freqtrade/data/history/datahandlers/idatahandler.py - About 45 mins to fix

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

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

          Function __init__ has a Cognitive Complexity of 8 (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 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 ohlcv_to_dataframe has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def ohlcv_to_dataframe(
          Severity: Minor
          Found in freqtrade/data/converter/converter.py - About 45 mins to fix

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

                def _validate_pairdata(
            Severity: Minor
            Found in freqtrade/data/history/datahandlers/idatahandler.py - About 45 mins to fix

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

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

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

                def _load_cached_data_for_updating(
                Severity: Minor
                Found in freqtrade/data/history/history_utils.py - About 45 mins to fix

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

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

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

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

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

                      def get_ui_download_url(version: Optional[str] = None) -> Tuple[str, str]:
                          base_url = "https://api.github.com/repos/freqtrade/frequi/"
                          # Get base UI Repo path
                      
                          resp = requests.get(f"{base_url}releases", timeout=req_timeout)
                      Severity: Minor
                      Found in freqtrade/commands/deploy_commands.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 _add_external_df has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def _add_external_df(
                      Severity: Minor
                      Found in freqtrade/data/dataprovider.py - About 45 mins to fix

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

                            def market_is_tradable(self, market: Dict[str, Any]) -> bool:
                                """
                                Check if the market symbol is tradable by Freqtrade.
                                Ensures that Configured mode aligns to
                                """
                        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

                        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

                        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
                          Severity
                          Category
                          Status
                          Source
                          Language