leandrotoledo/python-telegram-bot

View on GitHub

Showing 351 of 351 total issues

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

    def collect_additional_context(
Severity: Minor
Found in telegram/ext/_handlers/stringcommandhandler.py - About 45 mins to fix

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

        def __init__(
    Severity: Minor
    Found in telegram/_files/chatphoto.py - About 45 mins to fix

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

          def collect_additional_context(
      Severity: Minor
      Found in telegram/ext/_handlers/inlinequeryhandler.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                with new_option._unfrozen():
                                    new_option.text_parse_mode = self.defaults.text_parse_mode
                                new_val.append(new_option)
        Severity: Major
        Found in telegram/ext/_extbot.py - About 45 mins to fix

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

              def check_update(self, update: object) -> Optional[Union[bool, object]]:
                  """Determines whether an update should be passed to this handler's :attr:`callback`.
          
                  Args:
                      update (:class:`telegram.Update` | :obj:`object`): Incoming update.
          Severity: Minor
          Found in telegram/ext/_handlers/choseninlineresulthandler.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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(
                  self,
                  obj: Union[IO[bytes], bytes, str],
                  filename: Optional[str] = None,
                  attach: bool = False,
          Severity: Minor
          Found in telegram/_files/inputfile.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 collect_additional_context has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def collect_additional_context(
          Severity: Minor
          Found in telegram/ext/_handlers/prefixhandler.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if merged:
                                        return merged
                                return True
            Severity: Major
            Found in telegram/ext/filters.py - About 45 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in telegram/_chatbackground.py - About 45 mins to fix

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

                    def __init__(
                Severity: Minor
                Found in telegram/_payment/shippingoption.py - About 45 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in telegram/_loginurl.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if raw:
                                            continue
                                        effective_name = effective_name[:-4]
                    Severity: Major
                    Found in setup.py - About 45 mins to fix

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

                          def __init__(
                      Severity: Minor
                      Found in telegram/_messageorigin.py - About 45 mins to fix

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

                            def __init__(
                        Severity: Minor
                        Found in telegram/_payment/orderinfo.py - About 45 mins to fix

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

                          def autodoc_skip_member(app, what, name, obj, skip, options):
                          Severity: Minor
                          Found in docs/auxil/sphinx_hooks.py - About 45 mins to fix

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

                            def autodoc_process_docstring(
                            Severity: Minor
                            Found in docs/auxil/sphinx_hooks.py - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      if message := (
                                          self.message
                                          or self.edited_message
                                          or self.channel_post
                                          or self.edited_channel_post
                              Severity: Major
                              Found in telegram/_update.py - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if isinstance(val, DefaultValue):
                                                data[key] = self.defaults.api_defaults.get(key, val.value)
                                
                                            # 2)
                                            elif isinstance(val, datetime):
                                Severity: Major
                                Found in telegram/ext/_extbot.py - About 40 mins to fix

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

                                      def _parse_html(
                                  Severity: Minor
                                  Found in telegram/_message.py - About 35 mins to fix

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

                                        def __init__(
                                    Severity: Minor
                                    Found in telegram/_birthdate.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language