UsergeTeam / Userge

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
3 months ago3 months old
_dyno_saver_worker has a cyclomatic complexity of 17 with "high" risk
466
467
468@userge.add_task
469async def _dyno_saver_worker() -> None:470    count = 0
471    check_delay = 5
472    offline_start_time = time.time()
convert_usermode has a cyclomatic complexity of 21 with "high" risk
306             "{tr}convert_usermode -c=12345\n"
307             "{tr}convert_usermode -sc=yourcode"
308}, allow_channels=False)
309async def convert_usermode(msg: Message):310    """ convert to user mode """
311    if bool(config.SESSION_STRING):
312        return await msg.err("already using user mode")
unload has a cyclomatic complexity of 18 with "high" risk
198    'usage': "{tr}unload [flags] [name | names]",
199    'examples': [
200        "{tr}unload -p gdrive", "{tr}unload -c gls gup"]}, del_pre=True, allow_channels=False)
201async def unload(message: Message) -> None:202    """ unload plugins, commands, filters """
203    if not message.flags:
204        await message.err("flag required!")
status has a cyclomatic complexity of 19 with "high" risk
 21    'examples': [
 22        "{tr}status", "{tr}status -p",
 23        "{tr}status -p gdrive", "{tr}status -c {tr}gls"]}, del_pre=True, allow_channels=False)
 24async def status(message: Message) -> None: 25    """ view current status """
 26    name_ = message.filtered_input_str
 27    type_ = list(message.flags)
update has a cyclomatic complexity of 18 with "high" risk
458        "{tr}update -c -pull : pull latest updates to the core repo",
459        "{tr}update -r -pull : pull latest updates to the plugins repos"]
460}, del_pre=True, allow_channels=False)
461async def update(message: Message):462    """ check or do updates """
463    pull_in_flags = False
464    restart_in_flags = False