leandrotoledo/python-telegram-bot

View on GitHub

Showing 351 of 351 total issues

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

    def __init__(
Severity: Major
Found in telegram/_files/inputmedia.py - About 1 hr to fix

    Function __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(
            self: "Application[BT, CCT, UD, CD, BD, JQ]",
            *,
            bot: BT,
            update_queue: "asyncio.Queue[object]",
    Severity: Minor
    Found in telegram/ext/_application.py - About 1 hr to fix

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

          def __init__(
      Severity: Major
      Found in telegram/_inline/inlinequeryresultcachedaudio.py - About 1 hr to fix

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

        def check_keyboard_type(keyboard: object) -> bool:
            """Checks if the keyboard provided is of the correct type - A sequence of sequences.
            Implicitly tested in the init-tests of `{Inline, Reply}KeyboardMarkup`
            """
            # string and bytes may actually be used for ReplyKeyboardMarkup in which case each button
        Severity: Minor
        Found in telegram/_utils/markup.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 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Major
        Found in telegram/_inline/inputvenuemessagecontent.py - About 1 hr to fix

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

              def __init__(
          Severity: Major
          Found in telegram/_messageentity.py - About 1 hr to fix

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

                def _insert_callback_data(self, obj: HandledTypes) -> HandledTypes:
                    if self.callback_data_cache is None:
                        return obj
            
                    if isinstance(obj, CallbackQuery):
            Severity: Minor
            Found in telegram/ext/_extbot.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 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in telegram/ext/_extbot.py - About 1 hr to fix

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

                  def __init__(
              Severity: Major
              Found in telegram/ext/_defaults.py - About 1 hr to fix

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

                    def __init__(
                Severity: Major
                Found in telegram/request/_httpxrequest.py - About 1 hr to fix

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

                      def __init__(
                  Severity: Major
                  Found in telegram/_giveaway.py - About 1 hr to fix

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

                        def __init__(
                    Severity: Major
                    Found in telegram/_payment/precheckoutquery.py - About 1 hr to fix

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

                          def __init__(
                              self,
                              connection_pool_size: int = 1,
                              proxy_url: Optional[Union[str, httpx.Proxy, httpx.URL]] = None,
                              read_timeout: Optional[float] = 5.0,
                      Severity: Minor
                      Found in telegram/request/_httpxrequest.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 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(
                      Severity: Major
                      Found in telegram/_chatmemberupdated.py - About 1 hr to fix

                        Function __init__ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def __init__(
                                self,
                                update_id: int,
                                message: Optional[Message] = None,
                                edited_message: Optional[Message] = None,
                        Severity: Minor
                        Found in telegram/_update.py - About 1 hr to fix

                          Function __init__ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def __init__(
                                  self,
                                  origin: MessageOrigin,
                                  chat: Optional[Chat] = None,
                                  message_id: Optional[int] = None,
                          Severity: Minor
                          Found in telegram/_reply.py - About 1 hr to fix

                            Function __init__ has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def __init__(
                                    self,
                                    entry_points: List[BaseHandler[Update, CCT]],
                                    states: Dict[object, List[BaseHandler[Update, CCT]]],
                                    fallbacks: List[BaseHandler[Update, CCT]],
                            Severity: Minor
                            Found in telegram/ext/_handlers/conversationhandler.py - About 1 hr to fix

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

                                  def __init__(
                              Severity: Major
                              Found in telegram/_keyboardbuttonrequest.py - About 1 hr to fix

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

                                    def __init__(
                                Severity: Major
                                Found in telegram/_callbackquery.py - About 1 hr to fix

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

                                      def __init__(
                                  Severity: Major
                                  Found in telegram/_keyboardbutton.py - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language