telegram/ext/_jobqueue.py
File _jobqueue.py
has 753 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 run_repeating
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def run_repeating(
Function run_daily
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def run_daily(
Function run_monthly
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def run_monthly(
Function _parse_time_input
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def _parse_time_input(
self,
time: Union[float, datetime.timedelta, datetime.datetime, datetime.time, None],
shift_day: bool = False,
) -> Optional[datetime.datetime]:
- 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 run_once
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def run_once(
Function run_custom
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def run_custom(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Avoid too many return
statements within this function. Open
Open
return time