Showing 351 of 351 total issues
File _giveaway.py
has 261 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>
Function __init__
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function effective_chat
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def effective_chat(self) -> Optional["Chat"]:
"""
:class:`telegram.Chat`: The chat that this update was sent in, no matter what kind of
update this is.
If no chat is associated with this update, this gives :obj:`None`.
- Read upRead up
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 18 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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)
- Read upRead up
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.
Function __init__
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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
- Read upRead up
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**
- Read upRead up
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__(
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function run_webhook
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_webhook(
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",
- Read upRead up
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"