leandrotoledo/python-telegram-bot

View on GitHub

Showing 334 of 334 total issues

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

    def __init__(
Severity: Major
Found in telegram/_files/sticker.py - About 2 hrs to fix

    Function autodoc_process_bases has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def autodoc_process_bases(app, name, obj, option, bases: list) -> None:
        """Here we fine tune how the base class's classes are displayed."""
        for idx, raw_base in enumerate(bases):
            # let's use a string representation of the object
            base = str(raw_base)
    Severity: Minor
    Found in docs/auxil/sphinx_hooks.py - About 2 hrs 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

    ContextTypes has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ContextTypes(Generic[CCT, UD, CD, BD]):
        """
        Convenience class to gather customizable types of the :class:`telegram.ext.CallbackContext`
        interface.
    
    
    Severity: Minor
    Found in telegram/ext/_contexttypes.py - About 2 hrs to fix

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

          def __init__(
      Severity: Major
      Found in telegram/_poll.py - About 2 hrs to fix

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

            def __init__(
        Severity: Major
        Found in telegram/_chatadministratorrights.py - About 2 hrs to fix

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

              def __init__(
          Severity: Major
          Found in telegram/_inline/inlinequeryresultvideo.py - About 2 hrs to fix

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

                def __init__(
            Severity: Major
            Found in telegram/_inline/inlinequeryresultvenue.py - About 2 hrs to fix

              Function effective_user has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def effective_user(self) -> Optional["User"]:
                      """
                      :class:`telegram.User`: The user that sent this update, no matter what kind of update this
                      is. If no user is associated with this update, this gives :obj:`None`. This is the case
                      if any of
              Severity: Minor
              Found in telegram/_update.py - About 2 hrs 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 __process_message has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __process_message(self, message: Message) -> Optional[str]:
                      """As documented in process_message, but returns the uuid of the attached keyboard, if any,
                      which is relevant for process_callback_query.
              
                      **IN PLACE**
              Severity: Minor
              Found in telegram/ext/_callbackdatacache.py - About 2 hrs 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 16 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Major
              Found in telegram/_chatpermissions.py - About 2 hrs to fix

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

                    def __init__(
                Severity: Major
                Found in telegram/_inline/inlinequeryresultgif.py - About 2 hrs to fix

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

                      def __init__(
                  Severity: Major
                  Found in telegram/_inline/inlinequeryresultmpeg4gif.py - About 2 hrs to fix

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

                        def __init__(
                    Severity: Major
                    Found in telegram/_inline/inlinequeryresultlocation.py - About 2 hrs to fix

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

                          def __init__(
                      Severity: Major
                      Found in telegram/_inline/inlinequeryresultdocument.py - About 2 hrs to fix

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

                            def __init__(
                        Severity: Major
                        Found in telegram/_passport/encryptedpassportelement.py - About 2 hrs to fix

                          Function run_webhook has 15 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

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

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

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

                                  def __init__(
                                      self,
                                      id: int,
                                      type: str,
                                      title: Optional[str] = None,
                              Severity: Minor
                              Found in telegram/_chat.py - About 1 hr to fix

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

                                    def __init__(
                                        self,
                                        token: str,
                                        base_url: str = "https://api.telegram.org/bot",
                                        base_file_url: str = "https://api.telegram.org/file/bot",
                                Severity: Minor
                                Found in telegram/_bot.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 to_float_timestamp has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def to_float_timestamp(
                                    time_object: Union[float, dtm.timedelta, dtm.datetime, dtm.time],
                                    reference_timestamp: Optional[float] = None,
                                    tzinfo: Optional[dtm.tzinfo] = None,
                                ) -> float:
                                Severity: Minor
                                Found in telegram/_utils/datetime.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

                                Severity
                                Category
                                Status
                                Source
                                Language