Function upload
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def upload(files, to, config, delete_on_success, print_file_id, force_file, forward, directories, large_files, caption,
no_thumbnail, thumbnail_file, proxy, album, interactive, sort):
"""Upload one or more files to Telegram using your personal account.
The maximum file size is 2 GiB for free users and 4 GiB for premium accounts.
By default, they will be saved in your saved messages.
- 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 upload
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload(files, to, config, delete_on_success, print_file_id, force_file, forward, directories, large_files, caption,
Function get_file_display_name
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_file_display_name(message):
display_name_parts = []
is_document = message.document
if is_document and message.document.mime_type:
display_name_parts.append(message.document.mime_type.split('/')[0])
- 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 download
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def download(from_, config, delete_on_success, proxy, split_files, interactive):
Function download
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def download(from_, config, delete_on_success, proxy, split_files, interactive):
"""Download all the latest messages that are files in a chat, by default download
from "saved messages". It is recommended to forward the files to download to
"saved messages" and use parameter ``--delete-on-success``. Forwarded messages will
be removed from the chat after downloading, such as a download queue.
- 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"