Showing 334 of 334 total issues
Function _parse_markdown
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def _parse_markdown(
cls,
message_text: Optional[str],
entities: Dict[MessageEntity, str],
urled: bool = False,
- 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
File __init__.py
has 412 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>
File credentials.py
has 409 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 44 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
File _dictpersistence.py
has 389 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>
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>
#
File _reply.py
has 379 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 _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.
"""
- 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
File _baserequest.py
has 350 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>
File _callbackcontext.py
has 348 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>
File passportelementerrors.py
has 341 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>
File _poll.py
has 336 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>
File _callbackdatacache.py
has 335 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>
File _business.py
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# pylint: disable=redefined-builtin
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2024
Function __init__
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
store_data: Optional[PersistenceInput] = None,
user_data_json: str = "",
chat_data_json: str = "",
- 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
File _basepersistence.py
has 324 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>
File sticker.py
has 323 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 _parse_html
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _parse_html(
cls,
message_text: Optional[str],
entities: Dict[MessageEntity, str],
urled: bool = False,
- 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 filter
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def filter(self, update: Update) -> Union[bool, FilterDataDict]:
base_output = self.base_filter.check_update(update)
# We need to check if the filters are data filters and if so return the merged data.
# If it's not a data filter or an or_filter but no matches return bool
if self.and_filter:
- 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
File _chatboost.py
has 312 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>