leandrotoledo/python-telegram-bot

View on GitHub
docs/auxil/admonition_inserter.py

Summary

Maintainability
C
1 day
Test Coverage

File admonition_inserter.py has 387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#
#  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: Minor
Found in docs/auxil/admonition_inserter.py - About 5 hrs to fix

    Function _create_available_in has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def _create_available_in(self) -> dict[type, str]:
            """Creates a dictionary with 'Available in' admonitions for classes that are available
            in attributes of other classes.
            """
    
    
    Severity: Minor
    Found in docs/auxil/admonition_inserter.py - About 4 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

    There are no issues that match your filters.

    Category
    Status