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 Professor-99 branch #1

Merged
merged 1 commit into from Dec 11, 2021

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Dec 11, 2021

Branch Professor-99 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 Professor-99 branch, then run:

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

Help us improve this pull request!

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.

elif (chat_type == "group") or (chat_type == "supergroup"):
elif chat_type in ["group", "supergroup"]:
Copy link
Author

Choose a reason for hiding this comment

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

Function cb_handler refactored with the following changes:


Copy link
Author

Choose a reason for hiding this comment

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

Function start refactored with the following changes:

Comment on lines -41 to +57
elif (chat_type == "group") or (chat_type == "supergroup"):
elif chat_type in ["group", "supergroup"]:
grp_id = message.chat.id
title = message.chat.title
else:
return
st = await client.get_chat_member(grp_id, userid)
if not ((st.status == "administrator") or (st.status == "creator") or (str(userid) in Config.DEV_ID)):
if (
st.status != "administrator"
and st.status != "creator"
and str(userid) not in Config.DEV_ID
):
return
if len(args) < 2:
await message.reply_text("https://youtu.be/neJ4jHC9Hng", quote=True)
return
return
extracted = split_quotes(args[1])
text = extracted[0].lower()
text = extracted[0].lower()
Copy link
Author

Choose a reason for hiding this comment

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

Function addfilter refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator (merge-comparisons)
  • Simplify logical expression using De Morgan identities (de-morgan)

Comment on lines -169 to +184
elif (chat_type == "group") or (chat_type == "supergroup"):
elif chat_type in ["group", "supergroup"]:
grp_id = message.chat.id
title = message.chat.title
else:
return
userid = message.from_user.id
st = await client.get_chat_member(grp_id, userid)
if not ((st.status == "administrator") or (st.status == "creator") or (str(userid) in Config.AUTH_USERS)):
if (
st.status != "administrator"
and st.status != "creator"
and str(userid) not in Config.AUTH_USERS
):
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_all refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator (merge-comparisons)
  • Simplify logical expression using De Morgan identities (de-morgan)

Comment on lines -219 to +227
elif (chat_type == "group") or (chat_type == "supergroup"):
elif chat_type in ["group", "supergroup"]:
Copy link
Author

Choose a reason for hiding this comment

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

Function deletefilter refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator (merge-comparisons)
  • Simplify logical expression using De Morgan identities (de-morgan)

Comment on lines -540 to +577

if user_id not in VERIFY.get(str(chat_id)):
return

channel_id, channel_name = re.findall(r"connect\((.+)\)", query_data)[0].split("|", 1)

f_count = await db.cf_count(chat_id, int(channel_id))

remove_active = await db.del_active(chat_id, int(channel_id))

if not remove_active:
await update.answer("Couldnt Full Fill YOur Request...\n Report This @CrazyBotszGrp Along With Bot's Log", show_alert=True)
return

text= f"😑Sucessfully Disconnected From <code>{channel_name}</code>\n"
text+=f"\n😮‍💨Info About <b>{channel_name}</b>\n"
text+=f"\n😶‍🌫️Channel Name: <code>{channel_name}</code>\n"
text+=f"\n🆔Channel ID: <code>{channel_id}</code>\n"
text+=f"\n🗂️Channel Files: <code>{f_count}</code>\n"
text+=f"\n🤨Current Status: <code>Disconnected</code>\n"
text += '\n🤨Current Status: <code>Disconnected</code>\n'

buttons = [
[
InlineKeyboardButton
(
"💠 Connect 💠", callback_data=f"warn({channel_id}|{channel_name}|connect)"
),

InlineKeyboardButton
(
"Delete ❌", callback_data=f"warn({channel_id}|{channel_name}|c_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 cb_disconnect refactored with the following changes:

Comment on lines -613 to +622

if user_id not in VERIFY.get(str(chat_id)):
return

channel_id, channel_name = re.findall(r"c_delete\((.+)\)", query_data)[0].split("|", 1)
channel_id = int(channel_id)

Copy link
Author

Choose a reason for hiding this comment

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

Function cb_channel_delete refactored with the following changes:

Comment on lines -711 to +736

if user_id not in VERIFY.get(str(chat_id)):
return

chat_id = re.findall(r"types\((.+)\)", query_data)[0]

_types = await db.find_chat(int(chat_id))

text=f"<i>Filter Types Enabled/Disbled In <code>{chat_name}</code></i>\n"

_types = _types["types"]
vid = _types["video"]
doc = _types["document"]
aud = _types["audio"]

buttons = []

if vid:
text+="\n<i><b>Video Index:</b> Enabled</i>\n"
v_e = "✅"
vcb_data = f"toggle({chat_id}|video|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 cb_types refactored with the following changes:

Comment on lines -794 to +811

if user_id not in VERIFY.get(str(chat_id)):
return

chat_id, types, val = re.findall(r"toggle\((.+)\)", query_data)[0].split("|", 2)

_types = await db.find_chat(int(chat_id))

_types = _types["types"]
vid = _types["video"]
doc = _types["document"]
aud = _types["audio"]

if types == "video":
vid = True if val=="True" else False
elif types == "audio":
aud = True if val=="True" else False

if types == "audio":
aud = val=="True"
elif types == "document":
doc = True if val=="True" else False


doc = val=="True"


elif types == "video":
vid = val=="True"
Copy link
Author

Choose a reason for hiding this comment

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

Function cb_toggle refactored with the following changes:

Comment on lines -911 to +931

if user_id not in VERIFY.get(str(chat_id)):
return

chat_id = re.findall(r"config\((.+)\)", query_data)[0]

settings = await db.find_chat(int(chat_id))

mp_count = settings["configs"]["max_pages"]
mf_count = settings["configs"]["max_results"]
mr_count = settings["configs"]["max_per_page"]
show_invite = settings["configs"]["show_invite_link"]
pm_file_chat = settings["configs"].get("pm_fchat", False)
accuracy_point = settings["configs"].get("accuracy", 0.80)

text=f"<b>Configure Your <u><code>{chat_name}</code></u> Group's Filter Settings...</b>\n"

text+=f"\n{chat_name} Current Settings:\n"

text+=f"\n • Max Filter: <code>{mf_count}</code>\n"

text+=f"\n • Max Pages: <code>{mp_count}</code>\n"

text+=f"\n • Max Filter Per Page: <code>{mr_count}</code>\n"

text+=f"\n • Accuracy Percentage: <code>{accuracy_point}</code>\n"

text+=f"\n • Show Invitation Link: <code>{show_invite}</code>\n"

text+=f"\n • Provide File In Bot PM: <code>{pm_file_chat}</code>\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 cb_config refactored with the following changes:

Comment on lines -1206 to +1200

if user_id not in VERIFY.get(str(chat_id)):
return

value, chat_id = re.findall(r"show_invites\((.+)\)", query_data)[0].split("|", 1)
value = True if value=="True" else False

value = value=="True"

Copy link
Author

Choose a reason for hiding this comment

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

Function cb_show_invites refactored with the following changes:

Comment on lines -1267 to +1262

if user_id not in VERIFY.get(str(chat_id)):
return

value, chat_id = re.findall(r"inPM\((.+)\)", query_data)[0].split("|", 1)

value = True if value=="True" else False
value = value=="True"

Copy link
Author

Choose a reason for hiding this comment

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

Function cb_pm_file refactored with the following changes:

Comment on lines -1330 to +1328


if user_id not in VERIFY.get(str(chat_id)):
return

val, chat_id = re.findall(r"accuracy\((.+)\)", query_data)[0].split("|", 1)

text = f"<i>Choose Your Desired 'Accuracy Perceentage' For Every Filter Results Shown In</i> <code>{chat_name}</code>\n\n"
text+= f"<i>NB: Higher The Value Better Matching Results Will Be Provided... And If Value Is Lower It Will Show More Results \
Which Is Fimilary To Query Search (Wont Be Accurate)....</i>"
text += '<i>NB: Higher The Value Better Matching Results Will Be Provided... And If Value Is Lower It Will Show More Results \\\x1f Which Is Fimilary To Query Search (Wont Be Accurate)....</i>'

Copy link
Author

Choose a reason for hiding this comment

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

Function cb_accuracy refactored with the following changes:

Comment on lines -1401 to +1390

Copy link
Author

Choose a reason for hiding this comment

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

Function cb_set refactored with the following changes:

This removes the following comments ( why? ):

# Scophisticated way 😂🤣

Comment on lines -1532 to +1533

if user_id not in VERIFY.get(str(chat_id)):
return

text=f"<b><u>🤖Bot's Status</u></b>\n"
text = "<b><u>🤖Bot's Status</u></b>\n"
text+=f"\n🕐Bot's Uptime: <code>{time_formatter(time.time() - start_uptime)}</code>\n"
text+=f"\nBot Funtion: <b><>Auto Filter & Manual Filters</b>"
text += '\nBot Funtion: <b><>Auto Filter & Manual Filters</b>'

buttons = [[
InlineKeyboardButton("🔙 Back", callback_data="settings"),
InlineKeyboardButton("Close 🔐", callback_data="close")
]]
]]
Copy link
Author

Choose a reason for hiding this comment

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

Function cb_about refactored with the following changes:

Comment on lines -172 to +182
collections = mydb.list_collection_names()
collections = mydb.list_collection_names()

if "CONNECTION" in collections:
collections.remove("CONNECTION")
if "USERS" in collections:
collections.remove("USERS")
if "CONNECTION" in collections:
collections.remove("CONNECTION")
if "USERS" in collections:
collections.remove("USERS")

totalcount = 0
for collection in collections:
mycol = mydb[collection]
count = mycol.count()
totalcount = totalcount + count
totalcount = 0
for collection in collections:
mycol = mydb[collection]
count = mycol.count()
totalcount += count

totalcollections = len(collections)
totalcollections = len(collections)

return totalcollections, totalcount
return totalcollections, totalcount
Copy link
Author

Choose a reason for hiding this comment

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

Function filter_stats refactored with the following changes:

  • Replace assignment with augmented assignment (aug-assign)

Comment on lines -190 to +222
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "active_group": 0 }
)
if query is not None:
group_ids = []
for x in query["group_details"]:
group_ids.append(x["group_id"])

if group_id in group_ids:
return False

group_details = {
"group_id" : group_id
}

data = {
'_id': user_id,
'group_details' : [group_details],
'active_group' : group_id,
}

if mycol.count_documents( {"_id": user_id} ) == 0:
try:
mycol.insert_one(data)
return True
except:
print('Some error occured!')

else:
try:
mycol.update_one(
{'_id': user_id},
{
"$push": {"group_details": group_details},
"$set": {"active_group" : group_id}
}
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "active_group": 0 }
)
return True
except:
print('Some error occured!')
if query is not None:
group_ids = [x["group_id"] for x in query["group_details"]]
if group_id in group_ids:
return False

group_details = {
"group_id" : group_id
}

data = {
'_id': user_id,
'group_details' : [group_details],
'active_group' : group_id,
}

if mycol.count_documents( {"_id": user_id} ) == 0:
try:
mycol.insert_one(data)
return True
except:
print('Some error occured!')

else:
try:
mycol.update_one(
{'_id': user_id},
{
"$push": {"group_details": group_details},
"$set": {"active_group" : group_id}
}
)
return True
except:
print('Some error occured!')
Copy link
Author

Choose a reason for hiding this comment

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

Function add_connection refactored with the following changes:

Comment on lines -235 to +237
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "group_details": 0 }
)
if query:
group_id = query['active_group']
if group_id != None:
return int(group_id)
else:
return None
else:
return None
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "group_details": 0 }
)
if not query:
return None
group_id = query['active_group']
if group_id != None:
return int(group_id)
else:
return None
Copy link
Author

Choose a reason for hiding this comment

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

Function active_connection refactored with the following changes:

Comment on lines -249 to +247
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "active_group": 0 }
)
if query is not None:
group_ids = []
for x in query["group_details"]:
group_ids.append(x["group_id"])
return group_ids
else:
return None
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "active_group": 0 }
)
if query is not None:
return [x["group_id"] for x in query["group_details"]]
else:
return None
Copy link
Author

Choose a reason for hiding this comment

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

Function all_connections refactored with the following changes:

Comment on lines -263 to +255
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "group_details": 0 }
)
if query is not None:
if query['active_group'] == group_id:
return True
else:
return False
else:
return False
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0, "group_details": 0 }
)
return query is not None and query['active_group'] == group_id
Copy link
Author

Choose a reason for hiding this comment

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

Function if_active refactored with the following changes:

Comment on lines -277 to +263
update = mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : group_id}}
)
if update.modified_count == 0:
return False
else:
return True
update = mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : group_id}}
)
return update.modified_count != 0
Copy link
Author

Choose a reason for hiding this comment

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

Function make_active refactored with the following changes:

Comment on lines -288 to +271
update = mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : None}}
)
if update.modified_count == 0:
return False
else:
return True
update = mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : None}}
)
return update.modified_count != 0
Copy link
Author

Choose a reason for hiding this comment

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

Function make_inactive refactored with the following changes:

Comment on lines -299 to +302
try:
update = mycol.update_one(
{"_id": user_id},
{"$pull" : { "group_details" : {"group_id":group_id} } }
)
if update.modified_count == 0:
return False
else:
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0 }
)
if len(query["group_details"]) >= 1:
if query['active_group'] == group_id:
prvs_group_id = query["group_details"][len(query["group_details"]) - 1]["group_id"]

mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : prvs_group_id}}
)
else:
mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : None}}
)
return True
except Exception as e:
print(e)
return False
try:
update = mycol.update_one(
{"_id": user_id},
{"$pull" : { "group_details" : {"group_id":group_id} } }
)
if update.modified_count == 0:
return False
query = mycol.find_one(
{ "_id": user_id },
{ "_id": 0 }
)
if len(query["group_details"]) >= 1:
if query['active_group'] == group_id:
prvs_group_id = query["group_details"][len(query["group_details"]) - 1]["group_id"]

mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : prvs_group_id}}
)
else:
mycol.update_one(
{'_id': user_id},
{"$set": {"active_group" : None}}
)
return True
except Exception as e:
print(e)
return 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 delete_connection refactored with the following changes:

Comment on lines -343 to +318
count = aambro.count()
return count
return aambro.count()
Copy link
Author

Choose a reason for hiding this comment

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

Function all_users refactored with the following changes:

Comment on lines -360 to +352
if any(text.startswith(char) for char in START_CHAR):
counter = 1 # ignore first char -> is some kind of quote
while counter < len(text):
if text[counter] == "\\":
if not any(text.startswith(char) for char in START_CHAR):
return text.split(None, 1)
counter = 1 # ignore first char -> is some kind of quote
while counter < len(text):
if text[counter] == "\\":
counter += 1
elif text[counter] == text[0] or (text[0] == SMART_OPEN and text[counter] == SMART_CLOSE):
break
counter += 1
elif text[counter] == text[0] or (text[0] == SMART_OPEN and text[counter] == SMART_CLOSE):
break
counter += 1
else:
return text.split(None, 1)

# 1 to avoid starting quote, and counter is exclusive so avoids ending
key = remove_escapes(text[1:counter].strip())
# index will be in range, or `else` would have been executed and returned
rest = text[counter + 1:].strip()
if not key:
key = text[0] + text[0]
return list(filter(None, [key, rest]))
else:
return text.split(None, 1)

def parser(text, keyword):
if "buttonalert" in text:
text = (text.replace("\n", "\\n").replace("\t", "\\t"))
buttons = []
note_data = ""
prev = 0
i = 0
alerts = []
for match in BTN_URL_REGEX.finditer(text):
# Check if btnurl is escaped
n_escapes = 0
to_check = match.start(1) - 1
while to_check > 0 and text[to_check] == "\\":
n_escapes += 1
to_check -= 1

# if even, not escaped -> create button
if n_escapes % 2 == 0:
note_data += text[prev:match.start(1)]
prev = match.end(1)
if match.group(3) == "buttonalert":
# create a thruple with button label, url, and newline status
if bool(match.group(5)) and buttons:
buttons[-1].append(InlineKeyboardButton(
text=match.group(2),
callback_data=f"alertmessage:{i}:{keyword}"
))
else:
buttons.append([InlineKeyboardButton(
text=match.group(2),
callback_data=f"alertmessage:{i}:{keyword}"
)])
i = i + 1
alerts.append(match.group(4))
else:
if bool(match.group(5)) and buttons:
buttons[-1].append(InlineKeyboardButton(
text=match.group(2),
url=match.group(4).replace(" ", "")
))
else:
buttons.append([InlineKeyboardButton(
text=match.group(2),
url=match.group(4).replace(" ", "")
)])
return text.split(None, 1)

# if odd, escaped -> move along
else:
note_data += text[prev:to_check]
prev = match.start(1) - 1
else:
note_data += text[prev:]
# 1 to avoid starting quote, and counter is exclusive so avoids ending
key = remove_escapes(text[1:counter].strip())
# index will be in range, or `else` would have been executed and returned
rest = text[counter + 1:].strip()
if not key:
key = text[0] + text[0]
return list(filter(None, [key, rest]))
Copy link
Author

Choose a reason for hiding this comment

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

Function split_quotes refactored with the following changes:

if not len(message.command) > 1:
if len(message.command) <= 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 temp_ban_user refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

Comment on lines -40 to +80

while True:
broadcast_id = ''.join([random.choice(string.ascii_letters) for i in range(3)])
if not broadcast_ids.get(broadcast_id):
break

out = await m.reply_text(
text = f"Broadcast initiated! You will be notified with log file when all the users are notified."
text='Broadcast initiated! You will be notified with log file when all the users are notified.'
)

start_time = time.time()
total_users = await db.total_users_count()
done = 0
failed = 0
success = 0

broadcast_ids[broadcast_id] = dict(
total = total_users,
current = done,
failed = failed,
success = success
)

async with aiofiles.open('broadcast.txt', 'w') as broadcast_log_file:
async for user in all_users:

sts, msg = await send_msg(
user_id = int(user['id']),
message = broadcast_msg
)
if msg is not None:
await broadcast_log_file.write(msg)

if sts == 200:
success += 1
else:
failed += 1

if sts == 400:
await db.delete_user(user['id'])

Copy link
Author

Choose a reason for hiding this comment

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

Function broadcast_ refactored with the following changes:

covid_info = f"""<b>Covid 19 Information</b>
return f"""<b>Covid 19 Information</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 covid_info refactored with the following changes:

if not len(message.command) > 1:
if len(message.command) <= 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 temp_mute_user refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

Comment on lines -54 to +61
elif message.reply_to_message.text:
else:
message_s = message.reply_to_message.text

ext = "py"
x = await p_paste(message_s, ext)
p_link = x["url"]
p_raw = x["raw"]

Copy link
Author

Choose a reason for hiding this comment

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

Function pasty refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Dec 11, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 29.98 😞 28.92 😞 -1.06 👍
Method Length 121.90 😞 120.51 😞 -1.39 👍
Working memory 15.41 ⛔ 15.33 ⛔ -0.08 👍
Quality 43.55% 😞 43.91% 😞 0.36% 👍
Other metrics Before After Change
Lines 4669 4603 -66
Changed files Quality Before Quality After Quality Change
DonLee_Robot_V2/Callback.py 0.99% ⛔ 1.11% ⛔ 0.12% 👍
DonLee_Robot_V2/Commands.py 45.93% 😞 45.93% 😞 0.00%
DonLee_Robot_V2/Group.py 18.31% ⛔ 18.63% ⛔ 0.32% 👍
DonLee_Robot_V2/Admins/Admin_check.py 80.34% ⭐ 82.93% ⭐ 2.59% 👍
DonLee_Robot_V2/Admins/Admin_handling.py 47.02% 😞 49.14% 😞 2.12% 👍
DonLee_Robot_V2/AutoFilter/AutoFilter.py 42.49% 😞 43.60% 😞 1.11% 👍
DonLee_Robot_V2/AutoFilter/Channel.py 21.39% ⛔ 22.18% ⛔ 0.79% 👍
DonLee_Robot_V2/AutoFilter/Settings.py 51.47% 🙂 51.62% 🙂 0.15% 👍
DonLee_Robot_V2/Config_Vars/Vars.py 58.24% 🙂 58.40% 🙂 0.16% 👍
DonLee_Robot_V2/Database/Database.py 74.33% 🙂 75.17% ⭐ 0.84% 👍
DonLee_Robot_V2/Modules/Ban.py 64.04% 🙂 64.09% 🙂 0.05% 👍
DonLee_Robot_V2/Modules/Broadcast.py 30.99% 😞 31.02% 😞 0.03% 👍
DonLee_Robot_V2/Modules/Covid.py 59.76% 🙂 60.96% 🙂 1.20% 👍
DonLee_Robot_V2/Modules/Mute.py 63.08% 🙂 63.15% 🙂 0.07% 👍
DonLee_Robot_V2/Modules/Paste.py 66.21% 🙂 66.53% 🙂 0.32% 👍
DonLee_Robot_V2/Modules/Purge.py 55.68% 🙂 56.09% 🙂 0.41% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
DonLee_Robot_V2/Group.py auto_filter 151 ⛔ 1121 ⛔ 34 ⛔ 0.47% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
DonLee_Robot_V2/Callback.py cb_handler 83 ⛔ 1496 ⛔ 40 ⛔ 0.63% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
DonLee_Robot_V2/AutoFilter/AutoFilter.py cb_navg 51 ⛔ 740 ⛔ 31 ⛔ 3.78% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
DonLee_Robot_V2/AutoFilter/Channel.py connect 67 ⛔ 676 ⛔ 22 ⛔ 4.30% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
DonLee_Robot_V2/Group.py addfilter 55 ⛔ 559 ⛔ 20 ⛔ 6.77% ⛔ 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!

@PR0FESS0R-99 PR0FESS0R-99 merged commit 97a4ee2 into Professor-99 Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant