leandrotoledo/python-telegram-bot

View on GitHub
docs/auxil/sphinx_hooks.py

Summary

Maintainability
C
1 day
Test Coverage

Function autodoc_process_docstring has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def autodoc_process_docstring(
    app: Sphinx, what, name: str, obj: object, options, lines: list[str]
):
    """We do the following things:
    1) Use this method to automatically insert the Keyword Args and "Shortcuts" admonitions
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

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

Function autodoc_skip_member has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def autodoc_skip_member(app, what, name, obj, skip, options):
    """We use this to not document certain members like filter() or check_update() for filters.
    See https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#skipping-members"""

    included = {"MessageFilter", "UpdateFilter"}  # filter() and check_update() only for these.
Severity: Minor
Found in docs/auxil/sphinx_hooks.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 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

    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_bases has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def autodoc_process_bases(app, name, obj, option, bases: list) -> None:
      Severity: Minor
      Found in docs/auxil/sphinx_hooks.py - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status