EDM115 / unzip-bot

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
a month ago7 months old
unzipper_cb has a cyclomatic complexity of 168 with "critical" risk
 117
 118# Callbacks
 119@unzipperbot.on_callback_query()
 120async def unzipper_cb(unzip_bot: Client, query: CallbackQuery): 121    uid = query.from_user.id
 122    if uid != Config.BOT_OWNER:  # skipcq: PTC-W0048
 123        if await count_ongoing_tasks() >= Config.MAX_CONCURRENT_TASKS:
send_file has a cyclomatic complexity of 27 with "very-high" risk
 46
 47
 48# Send file to a user
 49async def send_file(unzip_bot, c_id, doc_f, query, full_path, log_msg, split): 50    fsize = await get_size(doc_f)
 51    if fsize in (-1, 0):  # File not found or empty
 52        try:
get_audio_metadata has a cyclomatic complexity of 20 with "high" risk
 14from unzipper.modules.ext_script.ext_helper import run_cmds_on_cr, __run_cmds_unzipper
 15
 16
 17async def get_audio_metadata(file_path): 18    file_ext = file_path.split(".")[-1].lower()
 19    audio_meta = {"performer": None, "title": None, "duration": None}
 20