Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored DOGE branch #4

Open
wants to merge 2 commits into
base: DOGE
Choose a base branch
from
Open

Sourcery refactored DOGE branch #4

wants to merge 2 commits into from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 25, 2021

Branch DOGE refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the DOGE branch, then run:

git fetch origin sourcery/DOGE
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from MUTLCC November 25, 2021 11:02
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to GitHub API limits, only the first 60 comments can be shown.

Comment on lines 214 to 225
Button.inline(f"🌟 Bᴇsᴛ - 🎞 ᴍᴋᴠ", data=f"ytdl_download_{vid}_mkv_v"),
Button.inline('🌟 Bᴇsᴛ - 🎞 ᴍᴋᴠ', data=f"ytdl_download_{vid}_mkv_v"),
Button.inline(
f"🌟 Bᴇsᴛ - 🎞 ᴡᴇʙᴍ/ᴍᴘ4",
data=f"ytdl_download_{vid}_mp4_v",
'🌟 Bᴇsᴛ - 🎞 ᴡᴇʙᴍ/ᴍᴘ4', data=f"ytdl_download_{vid}_mp4_v"
),
]
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function download_button refactored with the following changes:

Comment on lines -301 to +308
f"**🚨 Eʀʀoʀ:** The uploader hasn't made this video available in your country."
"**🚨 Eʀʀoʀ:** The uploader hasn't made this video available in your country."
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _tubeDl refactored with the following changes:

return f"\n\n<b>🧡 This user is my developer!</b>"
return '\n\n<b>🧡 This user is my developer!</b>'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function wowcmydev refactored with the following changes:

return f"\n\n<b>🤡 This user has been banned from using Doge.</b>"
return '\n\n<b>🤡 This user has been banned from using Doge.</b>'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function wowcg_y refactored with the following changes:

await edl(dogevent, f"**🚨 Eʀʀoʀ:**\n`ℹ️ Couldn't fetch the chat!`")
await edl(dogevent, "**🚨 Eʀʀoʀ:**\n`ℹ️ Couldn't fetch the chat!`")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_chatinfo refactored with the following changes:

return f"**🚨 Eʀʀoʀ:** While pasting text to site"
return '**🚨 Eʀʀoʀ:** While pasting text to site'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function paste_message refactored with the following changes:

c = title if title else "🐶 Doge UserBot 🐾"
c = title or "🐶 Doge UserBot 🐾"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function t_paste refactored with the following changes:

er = "pasty.lus.pm"
return {"error": f"`🚨 Unable to reach {er}!`"}
return {"error": f'`🚨 Unable to reach pasty.lus.pm!`'}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function p_paste refactored with the following changes:

Comment on lines 110 to 109
er = "spacebin"
return {"error": f"`🚨 Unable to reach {er}!`"}
return {"error": f'`🚨 Unable to reach spacebin!`'}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function s_paste refactored with the following changes:

Comment on lines 136 to 134
er = "nekobin"
return {"error": f"`🚨 Unable to reach {er}!`"}
return {"error": f'`🚨 Unable to reach nekobin!`'}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function n_paste refactored with the following changes:

Comment on lines 162 to 159
er = "catbin"
return {"error": f"`🚨 Unable to reach {er}!`"}
return {"error": f'`🚨 Unable to reach catbin!`'}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function d_paste refactored with the following changes:

elif media_t != "Sticker" and media_t:
else:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function afksetter refactored with the following changes:

Comment on lines 251 to 257
last = user.last_name if user.last_name else ""
last = user.last_name or ""
fullname = f"{first} {last}" if last else first
username = f"@{user.username}" if user.username else mention
me = await event.client.get_me()
my_mention = f"[{me.first_name}](tg://user?id={me.id})"
my_first = me.first_name
my_last = me.last_name if me.last_name else ""
my_last = me.last_name or ""
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function on_afk refactored with the following changes:

Comment on lines 48 to 79
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
try:
downloaded_file_name = await event.client.download_media(
reply_message,
"userbot/plugins/",
)
if "(" not in downloaded_file_name:
path1 = Path(downloaded_file_name)
shortname = path1.stem
shortestname = shortname.replace(".py", "")
try:
load_module(shortestname)
except ModuleNotFoundError as mnfe:
remove(downloaded_file_name)
return await edl(
event,
f"**🚨 Eʀʀoʀ:**\
if not event.reply_to_msg_id:
return
reply_message = await event.get_reply_message()
try:
downloaded_file_name = await event.client.download_media(
reply_message,
"userbot/plugins/",
)
if "(" not in downloaded_file_name:
path1 = Path(downloaded_file_name)
shortname = path1.stem
shortestname = shortname.replace(".py", "")
try:
load_module(shortestname)
except ModuleNotFoundError as mnfe:
remove(downloaded_file_name)
return await edl(
event,
f"**🚨 Eʀʀoʀ:**\
\n➡️ `{mnfe}`\
\n\
\n**🦴 Try to write** `{tr}finstall` **& reply.**",
15,
)
15,
)

try:
await reply_message.forward_to(PLUGIN_CHANNEL)
except Exception:
remove(downloaded_file_name)
return await edl(
event,
f"**🚨 Eʀʀoʀ:**\
try:
await reply_message.forward_to(PLUGIN_CHANNEL)
except Exception:
remove(downloaded_file_name)
return await edl(
event,
f"**🚨 Eʀʀoʀ:**\
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function install refactored with the following changes:

Comment on lines 125 to 151
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
try:
downloaded_file_name = await event.client.download_media(
reply_message,
"userbot/plugins/",
)
if "(" not in downloaded_file_name:
path1 = Path(downloaded_file_name)
shortname = path1.stem
shortestname = shortname.replace(".py", "")
try:
load_module(shortestname)
except ModuleNotFoundError as e:
install_pip(e.name)
sleep(1)
load_module(shortestname)
if not event.reply_to_msg_id:
return
reply_message = await event.get_reply_message()
try:
downloaded_file_name = await event.client.download_media(
reply_message,
"userbot/plugins/",
)
if "(" not in downloaded_file_name:
path1 = Path(downloaded_file_name)
shortname = path1.stem
shortestname = shortname.replace(".py", "")
try:
load_module(shortestname)
except ModuleNotFoundError as e:
install_pip(e.name)
sleep(1)
load_module(shortestname)

try:
await reply_message.forward_to(PLUGIN_CHANNEL)
except Exception:
remove(downloaded_file_name)
return await edl(
event,
f"**🚨 Eʀʀoʀ:**\
try:
await reply_message.forward_to(PLUGIN_CHANNEL)
except Exception:
remove(downloaded_file_name)
return await edl(
event,
f"**🚨 Eʀʀoʀ:**\
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function finstall refactored with the following changes:

outstr += f"**🔹 Iɴғo:** -\n\n"
outstr += '**🔹 Iɴғo:** -\n\n'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function plugininfo refactored with the following changes:

Comment on lines 262 to 271
return await edl(dogevent, f"**Error:**\n__Invalid dimension.__")
return await edl(dogevent, '**Error:**\n__Invalid dimension.__')
else:
try:
nw = int(args[0])
except ValueError:
return await edl(dogevent, f"**Error:**\n__Invalid width.__")
return await edl(dogevent, '**Error:**\n__Invalid width.__')
try:
nh = int(args[1])
except ValueError:
return await edl(dogevent, f"**Error:**\n__Invalid height.__")
return await edl(dogevent, '**Error:**\n__Invalid height.__')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function iresize refactored with the following changes:

await edl(output[0], f"**Error**\n`{str(e)}`")
await edl(output[0], f'**Error**\n`{e}`')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function txt_art refactored with the following changes:

Comment on lines 496 to 497
caption += m_st_r if m_st_r else ""
caption += g_y if g_y else ""
caption += m_st_r or ""
caption += g_y or ""
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function fetch_info refactored with the following changes:

Comment on lines 93 to 100
or f"https://raw.githubusercontent.com/DOG-E/Source/DOGE/Material/LogoBackgrounds/black.jpg"
or 'https://raw.githubusercontent.com/DOG-E/Source/DOGE/Material/LogoBackgrounds/black.jpg'
)

LOGO_FONT = (
gvar("LOGO_FONT")
or f"https://github.com/DOG-E/Source/raw/DOGE/Material/Fonts/streamster.ttf"
or 'https://github.com/DOG-E/Source/raw/DOGE/Material/Fonts/streamster.ttf'
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function very refactored with the following changes:

@sourcery-ai sourcery-ai bot changed the title a. (Sourcery refactored) Sourcery refactored DOGE branch Feb 27, 2022
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

sample_config.py Outdated
Comment on lines 20 to 21


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 67-67 refactored with the following changes:

if not self.jsobj:
return None
return self.jsobj
return None if not self.jsobj else self.jsobj
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Main.parse_storage.TheHTMLParser.result refactored with the following changes:

Comment on lines -339 to +337
opt_file = self.options.file
if opt_file:
if opt_file := self.options.file:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Main.create_file_name refactored with the following changes:

__copyright__ = "©️ Copyright 2021, " + __author__
__copyright__ = f"©️ Copyright 2021, {__author__}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 21-62 refactored with the following changes:

Comment on lines -33 to +35
LOGS.info(f"⏳ STARTING DOGE USERBOT 🐾")
LOGS.info("⏳ STARTING DOGE USERBOT 🐾")
doge.loop.run_until_complete(setup_bot())
LOGS.info(f"✅ STARTUP COMPLETED 🐾")
LOGS.info("✅ STARTUP COMPLETED 🐾")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 33-35 refactored with the following changes:

doginput = "Inline buttons " + markdown_note
doginput = f"Inline buttons {markdown_note}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function button refactored with the following changes:

Comment on lines -26 to +28
reply_pop_up_alert = f"🚨 Bu mesaj artık Doge sunucusunda yok."
reply_pop_up_alert = "🚨 Bu mesaj artık Doge sunucusunda yok."
else:
reply_pop_up_alert = f"🚨 Bu mesaj artık Doge sunucusunda yok."
reply_pop_up_alert = "🚨 Bu mesaj artık Doge sunucusunda yok."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function on_plug_in_callback_query_handler refactored with the following changes:

Comment on lines -78 to 80
event, f"**📺 Geçerli bir YouTube URL'sine girin veya cevap verin!**"
event, "**📺 Geçerli bir YouTube URL'sine girin veya cevap verin!**"
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function yt_inline refactored with the following changes:

Comment on lines -273 to +274
await c_q.answer(f"➡️ Görünüm olarak şu değiştirildi: 📜 Liste", alert=False)
await c_q.answer("➡️ Görünüm olarak şu değiştirildi: 📜 Liste", alert=False)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ytdl_callback refactored with the following changes:

Comment on lines -36 to +38
reply_pop_up_alert = f"🚨 Bu mesaj artık Doge sunucusunda yok."
reply_pop_up_alert = "🚨 Bu mesaj artık Doge sunucusunda yok."
else:
reply_pop_up_alert = f"🚨 Bu mesaj artık Doge sunucusunda yok."
reply_pop_up_alert = "🚨 Bu mesaj artık Doge sunucusunda yok."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function on_plug_in_callback_query_handler refactored with the following changes:

Comment on lines -30 to +42
if reply_message.media:
media = await reply_message.download_media()
if reply_message.text:
await doge.tgbot.send_file(chat, media, caption=reply_message.text)
else:
await doge.tgbot.send_file(chat, media)
return await event.delete()

else:
if not reply_message.media:
return await edl(
event,
"__Bot üzerinden ne göndermeliyim? Bana bir metin verin ya da mesajı yanıtlayın.__",
)

media = await reply_message.download_media()
if reply_message.text:
await doge.tgbot.send_file(chat, media, caption=reply_message.text)
else:
await doge.tgbot.send_file(chat, media)
return await event.delete()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function botmsg refactored with the following changes:

Comment on lines -36 to +38
reply_pop_up_alert = f"🚨 Bu mesaj artık Doge sunucusunda yok."
reply_pop_up_alert = "🚨 Bu mesaj artık Doge sunucusunda yok."
else:
reply_pop_up_alert = f"🚨 Bu mesaj artık Doge sunucusunda yok."
reply_pop_up_alert = "🚨 Bu mesaj artık Doge sunucusunda yok."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function on_plug_in_callback_query_handler refactored with the following changes:

Comment on lines -212 to +215
text = "**🐶 Doɢᴇ UsᴇʀBoᴛ Hᴀᴛᴀ Rᴀᴘᴏʀᴜ 🐾**"
text += "\n\n"
text = "**🐶 Doɢᴇ UsᴇʀBoᴛ Hᴀᴛᴀ Rᴀᴘᴏʀᴜ 🐾**" + "\n\n"
text += f"**🚨 Hata Raporu:** [{new['error']}]({pastelink})"
text += "\n\n"
link = f"[BURAYA](https://t.me/DogeSup)"
link = "[BURAYA](https://t.me/DogeSup)"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DogeUserBotClient.bot_cmd.decorator.wrapper refactored with the following changes:

Comment on lines -352 to +354
text = "**🐶 Doɢᴇ Asɪsᴛᴀɴ Hᴀᴛᴀ Rᴀᴘᴏʀᴜ 🐾**"
text += "\n\n"
text = "**🐶 Doɢᴇ Asɪsᴛᴀɴ Hᴀᴛᴀ Rᴀᴘᴏʀᴜ 🐾**" + "\n\n"
text += f"**🚨 Hata Raporu:** [{new['error']}]({pastelink})"
text += "\n\n"
link = f"[BURAYA](https://t.me/DogeSup)"
link = "[BURAYA](https://t.me/DogeSup)"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DogeUserBotClient.shiba_cmd.decorator.wrapper refactored with the following changes:

tmp_chelp += f"\n\n**🐾 Aʏᴀʀ:**"
tmp_chelp += "\\n\\n**🐾 Aʏᴀʀ:**"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _format_about refactored with the following changes:

Comment on lines -797 to +795
exact_size = (
",isz:ex,iszw:" + str(size_array[0]) + ",iszh:" + str(size_array[1])
)
exact_size = f",isz:ex,iszw:{str(size_array[0])},iszh:{str(size_array[1])}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function googleimagesdownload.build_url_parameters refactored with the following changes:

Comment on lines -977 to +978
for line in f:
if line not in ["\n", "\r\n"]:
search_keyword.append(line.replace("\n", "").replace("\r", ""))
search_keyword.extend(
line.replace("\n", "").replace("\r", "")
for line in f
if line not in ["\n", "\r\n"]
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function googleimagesdownload.keywords_from_file refactored with the following changes:

Comment on lines 990 to 989
dir_name_thumbnail = dir_name + " - thumbnail"
dir_name_thumbnail = f'{dir_name} - thumbnail'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function googleimagesdownload.create_directories refactored with the following changes:

Comment on lines -1028 to +1027
print("Image URL: " + image_url)
print(f"Image URL: {image_url}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function googleimagesdownload.download_image_thumbnail refactored with the following changes:

Comment on lines -1459 to +1451
arguments = {}
for i in args_list:
arguments[i] = None
arguments = {i: None for i in args_list}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function googleimagesdownload.download refactored with the following changes:

username = replied_user.user.username
if username:
if username := replied_user.user.username:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function slap refactored with the following changes:

horny = f"**Kategori:** "
horny = "**Kategori:** "
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function nsfw refactored with the following changes:

return str(round(size, 2)) + " " + dict_power_n[raised_to_pow] + "B"
return f'{str(round(size, 2))} {dict_power_n[raised_to_pow]}B'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function humanbytes refactored with the following changes:

Comment on lines -68 to +73
((str(days) + f" gün, ") if days else "")
+ ((str(hours) + f" saat, ") if hours else "")
+ ((str(minutes) + f" dakika, ") if minutes else "")
+ ((str(seconds) + f" saniye, ") if seconds else "")
(f"{str(days)} gün, " if days else "")
+ (f"{str(hours)} saat, " if hours else "")
+ (f"{str(minutes)} dakika, " if minutes else "")
+ (f"{str(seconds)} saniye, " if seconds else "")
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function time_formatter refactored with the following changes:

Comment on lines 81 to 84
((str(int(days)) + f" gün, ") if days else "")
+ ((str(int(hours)) + ":") if hours else "00:")
+ ((str(int(minutes)) + ":") if minutes else "00:")
(f"{int(days)} gün, " if days else "")
+ (f'{int(hours)}:' if hours else "00:")
+ (f'{int(minutes)}:' if minutes else "00:")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function readable_time refactored with the following changes:

outlineRange = int(fontSize / 15)
outlineRange = fontSize // 15
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function dogememify_helper refactored with the following changes:

Comment on lines 226 to 228
msg += f"\n**Genres:** "
msg += "\\n**Genres:** "
for g in jsonData["genres"]:
msg += g + " "
msg += f'{g} '
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function formatJSON refactored with the following changes:

description = description[0:200] + "....."
description = description[:200] + "....."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function shorten refactored with the following changes:

error = result.get("errors")
if error:
if error := result.get("errors"):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function anilist_user refactored with the following changes:

Comment on lines 330 to 331
image = post("https://graphql.anilist.co", json=data).json()["data"]["Media"][
"bannerImage"
]
if image:
if image := post("https://graphql.anilist.co", json=data).json()["data"][
"Media"
]["bannerImage"]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function getBannerLink refactored with the following changes:

Signed-off-by: TeleDoge <DogeUserBot@gmail.com>
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 27, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.17%.

Quality metrics Before After Change
Complexity 25.71 😞 25.39 😞 -0.32 👍
Method Length 128.65 😞 128.37 😞 -0.28 👍
Working memory 13.95 😞 13.92 😞 -0.03 👍
Quality 42.62% 😞 42.79% 😞 0.17% 👍
Other metrics Before After Change
Lines 18068 17993 -75
Changed files Quality Before Quality After Quality Change
sample_config.py 51.17% 🙂 53.56% 🙂 2.39% 👍
bin/cmrudl.py 73.58% 🙂 73.39% 🙂 -0.19% 👎
userbot/init.py 37.74% 😞 37.64% 😞 -0.10% 👎
userbot/main.py 72.58% 🙂 72.60% 🙂 0.02% 👍
userbot/assistant/bot_pms.py 37.55% 😞 38.50% 😞 0.95% 👍
userbot/assistant/botcontrols.py 53.22% 🙂 52.93% 🙂 -0.29% 👎
userbot/assistant/botmanagers.py 66.38% 🙂 66.61% 🙂 0.23% 👍
userbot/assistant/buttonmaker.py 45.57% 😞 45.54% 😞 -0.03% 👎
userbot/assistant/hide.py 76.14% ⭐ 76.45% ⭐ 0.31% 👍
userbot/assistant/iyoutube.py 35.67% 😞 35.74% 😞 0.07% 👍
userbot/assistant/secret.py 67.07% 🙂 67.35% 🙂 0.28% 👍
userbot/assistant/sendbot.py 60.34% 🙂 64.18% 🙂 3.84% 👍
userbot/assistant/troll.py 65.14% 🙂 65.42% 🙂 0.28% 👍
userbot/core/client.py 26.19% 😞 26.24% 😞 0.05% 👍
userbot/core/cmdinfo.py 31.58% 😞 31.65% 😞 0.07% 👍
userbot/core/events.py 41.40% 😞 41.40% 😞 0.00%
userbot/core/helpers.py 51.58% 🙂 51.49% 🙂 -0.09% 👎
userbot/core/inlinebot.py 21.70% ⛔ 21.71% ⛔ 0.01% 👍
userbot/core/managers.py 35.20% 😞 35.20% 😞 0.00%
userbot/helpers/google_image_download.py 38.16% 😞 38.28% 😞 0.12% 👍
userbot/helpers/memeshelper.py 76.53% ⭐ 74.30% 🙂 -2.23% 👎
userbot/helpers/nsfw.py 88.66% ⭐ 88.77% ⭐ 0.11% 👍
userbot/helpers/progress.py 52.11% 🙂 52.03% 🙂 -0.08% 👎
userbot/helpers/functions/calculate.py 61.67% 🙂 62.57% 🙂 0.90% 👍
userbot/helpers/functions/functions.py 79.49% ⭐ 79.47% ⭐ -0.02% 👎
userbot/helpers/functions/imgtools.py 56.67% 🙂 56.73% 🙂 0.06% 👍
userbot/helpers/functions/jikan.py 49.94% 😞 50.18% 🙂 0.24% 👍
userbot/helpers/functions/nekos.py 83.58% ⭐ 83.56% ⭐ -0.02% 👎
userbot/helpers/functions/utils.py 64.16% 🙂 64.11% 🙂 -0.05% 👎
userbot/helpers/functions/utube.py 64.99% 🙂 64.82% 🙂 -0.17% 👎
userbot/helpers/utils/events.py 52.01% 🙂 52.04% 🙂 0.03% 👍
userbot/helpers/utils/format.py 43.98% 😞 44.79% 😞 0.81% 👍
userbot/helpers/utils/paste.py 63.31% 🙂 63.39% 🙂 0.08% 👍
userbot/plugins/admin.py 40.05% 😞 40.05% 😞 0.00%
userbot/plugins/afk.py 16.54% ⛔ 16.61% ⛔ 0.07% 👍
userbot/plugins/alive.py 45.38% 😞 45.49% 😞 0.11% 👍
userbot/plugins/android.py 49.17% 😞 47.07% 😞 -2.10% 👎
userbot/plugins/antispambot.py 40.10% 😞 40.30% 😞 0.20% 👍
userbot/plugins/app.py 47.02% 😞 46.98% 😞 -0.04% 👎
userbot/plugins/archive.py 38.78% 😞 38.96% 😞 0.18% 👍
userbot/plugins/autoprofile.py 51.53% 🙂 51.12% 🙂 -0.41% 👎
userbot/plugins/blacklistwords.py 70.57% 🙂 70.57% 🙂 0.00%
userbot/plugins/carbon.py 54.17% 🙂 54.16% 🙂 -0.01% 👎
userbot/plugins/climate.py 50.07% 🙂 50.03% 🙂 -0.04% 👎
userbot/plugins/contacts.py 46.53% 😞 47.92% 😞 1.39% 👍
userbot/plugins/corecmds.py 54.96% 🙂 58.12% 🙂 3.16% 👍
userbot/plugins/countries.py 25.39% 😞 31.89% 😞 6.50% 👍
userbot/plugins/custom.py 7.47% ⛔ 7.60% ⛔ 0.13% 👍
userbot/plugins/dictionary.py 56.55% 🙂 58.94% 🙂 2.39% 👍
userbot/plugins/download.py 12.75% ⛔ 12.74% ⛔ -0.01% 👎
userbot/plugins/evaluators.py 55.41% 🙂 55.41% 🙂 0.00%
userbot/plugins/feds.py 35.38% 😞 35.99% 😞 0.61% 👍
userbot/plugins/ffmpeg.py 43.81% 😞 43.82% 😞 0.01% 👍
userbot/plugins/figlet.py 65.00% 🙂 66.10% 🙂 1.10% 👍
userbot/plugins/fileconverts.py 32.05% 😞 32.07% 😞 0.02% 👍
userbot/plugins/filesummary.py 15.62% ⛔ 15.62% ⛔ 0.00%
userbot/plugins/filters.py 45.23% 😞 45.95% 😞 0.72% 👍
userbot/plugins/gdrive.py 30.52% 😞 30.53% 😞 0.01% 👍
userbot/plugins/git.py 50.75% 🙂 50.71% 🙂 -0.04% 👎
userbot/plugins/google.py 47.80% 😞 47.77% 😞 -0.03% 👎
userbot/plugins/gps.py 65.25% 🙂 62.08% 🙂 -3.17% 👎
userbot/plugins/groupactions.py 21.85% ⛔ 21.85% ⛔ 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
userbot/core/inlinebot.py inline_handler 173 ⛔ 1516 ⛔ 37 ⛔ 0.29% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/plugins/afk.py on_afk 79 ⛔ 621 ⛔ 25 ⛔ 2.64% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/plugins/gdrive.py gdrive_download 54 ⛔ 665 ⛔ 34 ⛔ 3.07% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/helpers/google_image_download.py googleimagesdownload.download_image 55 ⛔ 631 ⛔ 28 ⛔ 3.70% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/plugins/download.py _ 52 ⛔ 651 ⛔ 29 ⛔ 3.95% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 27, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.15%.

Quality metrics Before After Change
Complexity 27.32 😞 27.04 😞 -0.28 👍
Method Length 130.40 😞 130.11 😞 -0.29 👍
Working memory 14.37 😞 14.35 😞 -0.02 👍
Quality 42.06% 😞 42.21% 😞 0.15% 👍
Other metrics Before After Change
Lines 18575 18469 -106
Changed files Quality Before Quality After Quality Change
sample_config.py 51.17% 🙂 53.56% 🙂 2.39% 👍
bin/cmrudl.py 73.58% 🙂 73.39% 🙂 -0.19% 👎
userbot/init.py 37.74% 😞 37.64% 😞 -0.10% 👎
userbot/main.py 72.58% 🙂 72.60% 🙂 0.02% 👍
userbot/assistant/bot_pms.py 37.55% 😞 38.50% 😞 0.95% 👍
userbot/assistant/botcontrols.py 53.22% 🙂 52.93% 🙂 -0.29% 👎
userbot/assistant/botmanagers.py 66.38% 🙂 66.61% 🙂 0.23% 👍
userbot/assistant/buttonmaker.py 45.57% 😞 45.54% 😞 -0.03% 👎
userbot/assistant/hide.py 76.14% ⭐ 76.45% ⭐ 0.31% 👍
userbot/assistant/iyoutube.py 35.67% 😞 35.74% 😞 0.07% 👍
userbot/assistant/secret.py 67.07% 🙂 67.35% 🙂 0.28% 👍
userbot/assistant/sendbot.py 60.34% 🙂 64.18% 🙂 3.84% 👍
userbot/assistant/troll.py 65.14% 🙂 65.42% 🙂 0.28% 👍
userbot/core/client.py 26.19% 😞 26.24% 😞 0.05% 👍
userbot/core/cmdinfo.py 31.58% 😞 31.65% 😞 0.07% 👍
userbot/core/events.py 41.40% 😞 41.40% 😞 0.00%
userbot/core/helpers.py 51.58% 🙂 51.49% 🙂 -0.09% 👎
userbot/core/inlinebot.py 21.70% ⛔ 21.71% ⛔ 0.01% 👍
userbot/core/managers.py 35.20% 😞 35.20% 😞 0.00%
userbot/helpers/google_image_download.py 38.16% 😞 38.28% 😞 0.12% 👍
userbot/helpers/memeshelper.py 76.53% ⭐ 74.30% 🙂 -2.23% 👎
userbot/helpers/nsfw.py 88.66% ⭐ 88.77% ⭐ 0.11% 👍
userbot/helpers/progress.py 52.11% 🙂 52.03% 🙂 -0.08% 👎
userbot/helpers/qhelper.py 22.38% ⛔ 22.38% ⛔ 0.00%
userbot/helpers/functions/calculate.py 61.67% 🙂 63.12% 🙂 1.45% 👍
userbot/helpers/functions/functions.py 79.49% ⭐ 79.47% ⭐ -0.02% 👎
userbot/helpers/functions/imgtools.py 56.67% 🙂 56.73% 🙂 0.06% 👍
userbot/helpers/functions/jikan.py 49.94% 😞 50.18% 🙂 0.24% 👍
userbot/helpers/functions/nekos.py 83.58% ⭐ 83.56% ⭐ -0.02% 👎
userbot/helpers/functions/utils.py 64.16% 🙂 64.11% 🙂 -0.05% 👎
userbot/helpers/functions/utube.py 64.99% 🙂 64.82% 🙂 -0.17% 👎
userbot/helpers/utils/events.py 52.01% 🙂 52.04% 🙂 0.03% 👍
userbot/helpers/utils/format.py 43.98% 😞 44.79% 😞 0.81% 👍
userbot/helpers/utils/paste.py 63.31% 🙂 63.39% 🙂 0.08% 👍
userbot/plugins/admin.py 40.05% 😞 40.05% 😞 0.00%
userbot/plugins/afk.py 16.54% ⛔ 16.61% ⛔ 0.07% 👍
userbot/plugins/alive.py 45.38% 😞 45.49% 😞 0.11% 👍
userbot/plugins/android.py 49.17% 😞 47.07% 😞 -2.10% 👎
userbot/plugins/antispambot.py 40.10% 😞 40.30% 😞 0.20% 👍
userbot/plugins/app.py 47.02% 😞 46.98% 😞 -0.04% 👎
userbot/plugins/archive.py 38.78% 😞 38.96% 😞 0.18% 👍
userbot/plugins/autoprofile.py 51.53% 🙂 51.12% 🙂 -0.41% 👎
userbot/plugins/blacklistwords.py 70.57% 🙂 70.57% 🙂 0.00%
userbot/plugins/carbon.py 54.17% 🙂 54.16% 🙂 -0.01% 👎
userbot/plugins/climate.py 50.07% 🙂 50.03% 🙂 -0.04% 👎
userbot/plugins/contacts.py 46.53% 😞 47.92% 😞 1.39% 👍
userbot/plugins/corecmds.py 54.96% 🙂 58.12% 🙂 3.16% 👍
userbot/plugins/countries.py 25.39% 😞 31.89% 😞 6.50% 👍
userbot/plugins/custom.py 7.47% ⛔ 7.60% ⛔ 0.13% 👍
userbot/plugins/dictionary.py 56.55% 🙂 58.94% 🙂 2.39% 👍
userbot/plugins/download.py 12.75% ⛔ 12.74% ⛔ -0.01% 👎
userbot/plugins/evaluators.py 55.41% 🙂 55.41% 🙂 0.00%
userbot/plugins/feds.py 35.38% 😞 35.99% 😞 0.61% 👍
userbot/plugins/ffmpeg.py 43.81% 😞 43.82% 😞 0.01% 👍
userbot/plugins/figlet.py 65.00% 🙂 66.10% 🙂 1.10% 👍
userbot/plugins/fileconverts.py 32.05% 😞 32.07% 😞 0.02% 👍
userbot/plugins/filesummary.py 15.62% ⛔ 15.62% ⛔ 0.00%
userbot/plugins/filters.py 45.23% 😞 45.95% 😞 0.72% 👍
userbot/plugins/gdrive.py 30.52% 😞 30.53% 😞 0.01% 👍
userbot/plugins/git.py 50.75% 🙂 50.71% 🙂 -0.04% 👎
userbot/plugins/google.py 47.80% 😞 47.77% 😞 -0.03% 👎
userbot/plugins/gps.py 65.25% 🙂 62.08% 🙂 -3.17% 👎
userbot/plugins/groupactions.py 21.85% ⛔ 21.85% ⛔ 0.00%
userbot/plugins/speedtest.py 52.26% 🙂 52.26% 🙂 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
userbot/core/inlinebot.py inline_handler 173 ⛔ 1516 ⛔ 37 ⛔ 0.29% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/helpers/qhelper.py process 121 ⛔ 1448 ⛔ 38 ⛔ 0.29% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/plugins/afk.py on_afk 79 ⛔ 621 ⛔ 25 ⛔ 2.64% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/plugins/gdrive.py gdrive_download 54 ⛔ 665 ⛔ 34 ⛔ 3.07% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
userbot/helpers/google_image_download.py googleimagesdownload.download_image 55 ⛔ 631 ⛔ 28 ⛔ 3.70% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant