leandrotoledo/python-telegram-bot

View on GitHub
telegram/_files/inputmedia.py

Summary

Maintainability
D
2 days
Test Coverage

File inputmedia.py has 503 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2024
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
Severity: Major
Found in telegram/_files/inputmedia.py - About 1 day to fix

    Function __init__ has 13 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 12 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 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 9 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 8 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 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

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

                    def __init__(
                        self,
                        media: Union[FileInput, Animation],
                        caption: Optional[str] = None,
                        parse_mode: ODVInput[str] = DEFAULT_NONE,
                Severity: Minor
                Found in telegram/_files/inputmedia.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,
                        media: Union[FileInput, Video],
                        caption: Optional[str] = None,
                        width: Optional[int] = None,
                Severity: Minor
                Found in telegram/_files/inputmedia.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,
                        media: Union[FileInput, Audio],
                        caption: Optional[str] = None,
                        parse_mode: ODVInput[str] = DEFAULT_NONE,
                Severity: Minor
                Found in telegram/_files/inputmedia.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

                There are no issues that match your filters.

                Category
                Status