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 main branch #472

Merged
merged 1 commit into from
Aug 2, 2022
Merged

Sourcery refactored main branch #472

merged 1 commit into from
Aug 2, 2022

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 2, 2022

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

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from rtk-rnjn August 2, 2022 18:15
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.

Comment on lines -209 to +211
keys = list(iterkeys(self))
keys.sort()
keys = sorted(iterkeys(self))
args = ", ".join(["%s=%r" % (key, self[key]) for key in keys])
return "%s(%s)" % (self.__class__.__name__, args)
return f"{self.__class__.__name__}({args})"
Copy link
Author

Choose a reason for hiding this comment

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

Function Object.__repr__ refactored with the following changes:

Comment on lines -255 to +254
if isinstance(x, (list, tuple)):
return type(x)(objectify(v) for v in x)
return x
return type(x)(objectify(v) for v in x) if isinstance(x, (list, tuple)) else x
Copy link
Author

Choose a reason for hiding this comment

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

Function objectify refactored with the following changes:

Comment on lines -371 to +368
opts = dict(indent=4, default_flow_style=False)
opts.update(options)
opts = dict(indent=4, default_flow_style=False) | options
Copy link
Author

Choose a reason for hiding this comment

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

Function toYAML refactored with the following changes:

if not data:
return {}
return dict(zip(data[0], zip(data[0][10:], data[0][5:10])))
return dict(zip(data[0], zip(data[0][10:], data[0][5:10]))) if data 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 get_batting refactored with the following changes:

Comment on lines -88 to +86
if not data:
return {}
return dict(zip(data[1], zip(data[1][10:], data[1][5:10])))
return dict(zip(data[1], zip(data[1][10:], data[1][5:10]))) if data 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 get_bowling refactored with the following changes:

Comment on lines -468 to +455
chn = self.__guild.get_channel(channel)
if chn:
if chn := self.__guild.get_channel(channel):
Copy link
Author

Choose a reason for hiding this comment

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

Function BaseCustomCommand.get_overwrites_for refactored with the following changes:

Comment on lines -544 to +541
for reaction in self.__message.reactions:
if str(reaction.emoji) == emoji:
return [
return next(
(
[
CustomMember(member)
async for member in reaction.users()
if isinstance(member, discord.Member)
]
return []
for reaction in self.__message.reactions
if str(reaction.emoji) == emoji
),
[],
)
Copy link
Author

Choose a reason for hiding this comment

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

Function BaseCustomCommandOnMsg.reactions_users refactored with the following changes:

  • Use the built-in function next instead of a for-loop (use-next)

Comment on lines -120 to +150
if not ctx.invoked_subcommand:
try:
starboard_data: Dict[
str, Union[str, int, List[int], bool, None]
] = self.bot.server_config[ctx.guild.id]["starboard"]
except KeyError:
return await self.bot.invoke_help_command(ctx)
if ctx.invoked_subcommand:
return
try:
starboard_data: Dict[
str, Union[str, int, List[int], bool, None]
] = self.bot.server_config[ctx.guild.id]["starboard"]
except KeyError:
return await self.bot.invoke_help_command(ctx)

channel: Optional[discord.TextChannel] = ctx.guild.get_channel(
starboard_data.get("channel", 0)
)
limit: Optional[int] = starboard_data.get("limit")
is_locked: Optional[bool] = starboard_data.get("is_locked")
channel: Optional[discord.TextChannel] = ctx.guild.get_channel(
starboard_data.get("channel", 0)
)
limit: Optional[int] = starboard_data.get("limit")
is_locked: Optional[bool] = starboard_data.get("is_locked")

ignore_channel = ", ".join(
[
f"{ctx.guild.get_channel(c)} ({c})"
for c in starboard_data.get("ignore_channel", [])
]
)
max_duration: Optional[str] = starboard_data.get("max_duration")
ignore_channel = ", ".join(
[
f"{ctx.guild.get_channel(c)} ({c})"
for c in starboard_data.get("ignore_channel", [])
]
)
max_duration: Optional[str] = starboard_data.get("max_duration")

return await ctx.reply(
f"Configuration of this server [starboard]\n\n"
f"`Channel :` **{channel.mention if channel else 'None'} ({starboard_data.get('channel')})**\n"
f"`Limit :` **{limit}**\n"
f"`Locked :` **{is_locked}**\n"
f"`Ignore :` **{ignore_channel or 'None'}**\n"
f"`Duration:` **{max_duration}**\n"
)
return await ctx.reply(
f"Configuration of this server [starboard]\n\n"
f"`Channel :` **{channel.mention if channel else 'None'} ({starboard_data.get('channel')})**\n"
f"`Limit :` **{limit}**\n"
f"`Locked :` **{is_locked}**\n"
f"`Ignore :` **{ignore_channel or 'None'}**\n"
f"`Duration:` **{max_duration}**\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 Configuration.starboard refactored with the following changes:

Comment on lines -238 to +273
if not ctx.invoked_subcommand:
chn: discord.TextChannel = channel or ctx.channel
if event.lower() not in events:
return await ctx.reply(
f"{ctx.author.mention} invalid event. Available events `{'`, `'.join(events)}`"
)
hooks: List[discord.Webhook] = await chn.webhooks()
if len(hooks) >= 10:
for hook in hooks:
if hook is not None and hook.user.id == self.bot.user.id: # type: ignore
webhook = hook
post = {str(event.lower()): str(webhook.url)}
await self.bot.mongo.parrot_db.logging.update_one(
{"_id": ctx.guild.id}, {"$set": post}, upsert=True
)
break
else:
return await ctx.reply(
f"{ctx.author.mention} can not register event (`{event.replace('_', ' ').title()}`) in {chn.mention}. This happens when channel has already 10 webhooks created."
if ctx.invoked_subcommand:
return
chn: discord.TextChannel = channel or ctx.channel
if event.lower() not in events:
return await ctx.reply(
f"{ctx.author.mention} invalid event. Available events `{'`, `'.join(events)}`"
)
hooks: List[discord.Webhook] = await chn.webhooks()
if len(hooks) >= 10:
for hook in hooks:
if hook is not None and hook.user.id == self.bot.user.id: # type: ignore
webhook = hook
post = {event.lower(): str(webhook.url)}
await self.bot.mongo.parrot_db.logging.update_one(
{"_id": ctx.guild.id}, {"$set": post}, upsert=True
)
break
else:
webhook: discord.Webhook = await chn.create_webhook(
name=self.bot.user.name,
reason=f"On request from {ctx.author} ({ctx.author.id}) | Reason: Setting Up Logging",
)
await self.bot.mongo.parrot_db.logging.update_one(
{"_id": ctx.guild.id},
{"$set": {str(event): str(webhook.url)}},
upsert=True,
return await ctx.reply(
f"{ctx.author.mention} can not register event (`{event.replace('_', ' ').title()}`) in {chn.mention}. This happens when channel has already 10 webhooks created."
)
await ctx.reply(
f"{ctx.author.mention} all `{event.replace('_', ' ').title()}` will be posted on {chn.mention}"
else:
webhook: discord.Webhook = await chn.create_webhook(
name=self.bot.user.name,
reason=f"On request from {ctx.author} ({ctx.author.id}) | Reason: Setting Up Logging",
)
await self.bot.mongo.parrot_db.logging.update_one(
{"_id": ctx.guild.id},
{"$set": {event: str(webhook.url)}},
upsert=True,
)

await ctx.reply(
f"{ctx.author.mention} all `{event.replace('_', ' ').title()}` will be posted on {chn.mention}"
)
Copy link
Author

Choose a reason for hiding this comment

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

Function Configuration.logging refactored with the following changes:

Comment on lines -281 to +286
{"_id": ctx.guild.id}, {"$set": {str(event.lower()): ""}}
{"_id": ctx.guild.id}, {"$set": {event.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 Configuration.logging_remove refactored with the following changes:

Comment on lines -392 to +401
"duration": duration if duration else None,
"duration": duration or 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 Configuration.warnadd refactored with the following changes:

Comment on lines -555 to +565
if setting.lower() in ("ignore-role", "ignore_role", "ignorerole", "ignore"):
if setting.lower() in {
"ignore-role",
"ignore_role",
"ignorerole",
"ignore",
}:
Copy link
Author

Choose a reason for hiding this comment

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

Function Configuration.gsetup refactored with the following changes:

Comment on lines +1574 to +1618
if ctx.invoked_subcommand is not None:
return
try:
server_stats: Dict[str, Any] = self.bot.server_config[ctx.guild.id][
"stats_channels"
]
except KeyError:
return await self.bot.invoke_help_command(ctx)
table = []
table_role = []
if ctx.invoked_subcommand is None:
try:
server_stats: Dict[str, Any] = self.bot.server_config[ctx.guild.id][
"stats_channels"
]
except KeyError:
return await self.bot.invoke_help_command(ctx)
for key, value in server_stats.items():
if key != "role":
chn = (
self.bot.get_channel(value["channel_id"])
if value.get("channel_id")
else 0
)
table.append(
[
key.title(),
f"#{chn.name}" if chn else "None",
value.get("channel_type"),
value.get("template"),
]
)
for _role in server_stats.get("role", {}):
role = ctx.guild.get_role(_role.get("role_id", 0))
channel = ctx.guild.get_channel(_role.get("channel_id", 0))
template = _role.get("template")
channel_type = _role.get("channel_type")
table_role.append(
for key, value in server_stats.items():
if key != "role":
chn = (
self.bot.get_channel(value["channel_id"])
if value.get("channel_id")
else 0
)
table.append(
[
role.name if role else "None",
channel.name if channel else "None",
channel_type,
template,
key.title(),
f"#{chn.name}" if chn else "None",
value.get("channel_type"),
value.get("template"),
]
)
await ctx.send(
f"""```
table_role = []
for _role in server_stats.get("role", {}):
role = ctx.guild.get_role(_role.get("role_id", 0))
channel = ctx.guild.get_channel(_role.get("channel_id", 0))
template = _role.get("template")
channel_type = _role.get("channel_type")
table_role.append(
[
role.name if role else "None",
channel.name if channel else "None",
channel_type,
template,
]
)
await ctx.send(
f"""```
{str(tabulate(table, headers=["Name", "Channel", "Type", "Template"], tablefmt="pretty"))}
``````
{str(tabulate(table_role, headers=["Role", "Channel", "Type", "Template"], tablefmt="pretty"))}
```"""
)
)
Copy link
Author

Choose a reason for hiding this comment

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

Function Configuration.serverstats refactored with the following changes:

Comment on lines -152 to -155
easterified_data_set = {}
easterified_data_set = {x: PfpEffects.closest(x) for x in data_set}

for x in data_set:
easterified_data_set[x] = PfpEffects.closest(x)
Copy link
Author

Choose a reason for hiding this comment

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

Function PfpEffects.easterify_effect refactored with the following changes:

Comment on lines -297 to +295
new_img = PfpEffects.join_images(img_squares)

return new_img
return PfpEffects.join_images(img_squares)
Copy link
Author

Choose a reason for hiding this comment

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

Function PfpEffects.mosaic_effect refactored with the following changes:

Comment on lines -1290 to -1296
error_embed = discord.Embed(
return discord.Embed(
colour=Colours.soft_red,
title=random.choice(NEGATIVE_REPLIES),
description=f"{desc}", # fuck you pycord
)

return error_embed
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.make_error_embed refactored with the following changes:

Comment on lines -1480 to +1476
if len(player_data) == 0:
if not player_data:
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.send_score refactored with the following changes:

Comment on lines -1732 to +1728
if (animal := animal.lower()) in (
if (animal := animal.lower()) not in (
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.animal_fact refactored with the following changes:

Comment on lines -1908 to +1905
if len(ret) >= 2048:
return ret[0:2000] + " [...]"
return ret
return ret[:2000] + " [...]" if len(ret) >= 2048 else ret
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.urbandictionary refactored with the following changes:

Comment on lines -1958 to +1953
if len(member.name) > 20:
name = member.name[:20:]
else:
name = member.name
name = member.name[:20:] if len(member.name) > 20 else member.name
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.ytcomment refactored with the following changes:

Comment on lines -2049 to +2047
em.set_footer(text=f"{ctx.author.name}")
else:
em = discord.Embed(
title=f"{member.name} reply!",
description=f"{random.choice(t)}",
timestamp=discord.utils.utcnow(),
)
em.set_footer(text=f"{ctx.author.name}")
em.set_footer(text=f"{ctx.author.name}")
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.truth refactored with the following changes:

Comment on lines -2072 to +2069
em.set_footer(text=f"{ctx.author}")
else:
em = discord.Embed(
title=f"{member} reply!",
description=f"{random.choice(t)}",
timestamp=discord.utils.utcnow(),
)
em.set_footer(text=f"{ctx.author}")
em.set_footer(text=f"{ctx.author}")
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.twister refactored with the following changes:

Comment on lines -2114 to +2104
params = {"image_url": member.display_avatar.url, "axis": axis if axis else "X"}
params = {"image_url": member.display_avatar.url, "axis": axis or "X"}
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.shear refactored with the following changes:

Comment on lines -2160 to +2150
choose = "tails" if str(choose).lower() in ("tails", "tail", "t") else "heads"
choose = "tails" if choose.lower() in {"tails", "tail", "t"} else "heads"
Copy link
Author

Choose a reason for hiding this comment

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

Function Fun.coinflip refactored with the following changes:

if displayname not in new_name:
return new_name
return None
return new_name if displayname not in new_name else 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 Easter.find_separators refactored with the following changes:

for index, command in enumerate(commands_list):
for command in commands_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 GroupHelpPageSource.format_page refactored with the following changes:

alias = command.name if not parent else f"{parent} {command.name}"
alias = f"{parent} {command.name}" if parent else command.name
Copy link
Author

Choose a reason for hiding this comment

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

Function PaginatedHelpCommand.get_command_signature refactored with the following changes:

syntax = self.get_command_signature(command)
if syntax:
if syntax := self.get_command_signature(command):
Copy link
Author

Choose a reason for hiding this comment

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

Function PaginatedHelpCommand.common_command_formatting refactored with the following changes:

Comment on lines -366 to +369
if len(subcommands) == 0:
if not subcommands:
return await self.send_command_help(group)
entries = subcommands
# entries = await self.filter_commands(subcommands, sort=True)
if len(entries) == 0:
if not entries:
Copy link
Author

Choose a reason for hiding this comment

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

Function PaginatedHelpCommand.send_group_help refactored with the following changes:

@@ -536,7 +535,6 @@ async def server_info(self, ctx: Context):
for name, value, inline in fields:
embed.add_field(name=name, value=value, inline=inline)

info = []
Copy link
Author

Choose a reason for hiding this comment

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

Function Meta.server_info refactored with the following changes:

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for contributing to Parrot :)

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Aug 2, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 8.62 🙂 8.27 ⭐ -0.35 👍
Method Length 99.05 🙂 98.78 🙂 -0.27 👍
Working memory 8.86 🙂 8.89 🙂 0.03 👎
Quality 58.14% 🙂 58.35% 🙂 0.21% 👍
Other metrics Before After Change
Lines 33594 33379 -215
Changed files Quality Before Quality After Quality Change
ARCHIVED/object.py 90.53% ⭐ 90.89% ⭐ 0.36% 👍
api/cricket_api/functions.py 87.59% ⭐ 88.56% ⭐ 0.97% 👍
cogs/api/api.py 66.98% 🙂 67.03% 🙂 0.05% 👍
cogs/cc/cc.py 54.62% 🙂 54.50% 🙂 -0.12% 👎
cogs/cc/method.py 82.14% ⭐ 82.25% ⭐ 0.11% 👍
cogs/config/config.py 53.15% 🙂 53.62% 🙂 0.47% 👍
cogs/fun/_effects.py 72.36% 🙂 72.65% 🙂 0.29% 👍
cogs/fun/fun.py 52.48% 🙂 52.54% 🙂 0.06% 👍
cogs/holidays/easter/easter.py 59.00% 🙂 58.61% 🙂 -0.39% 👎
cogs/holidays/pride/init.py 72.29% 🙂 72.42% 🙂 0.13% 👍
cogs/ipc/ipc.py 73.66% 🙂 73.15% 🙂 -0.51% 👎
cogs/love/love.py 64.05% 🙂 63.80% 🙂 -0.25% 👎
cogs/meta/meta.py 56.17% 🙂 56.91% 🙂 0.74% 👍
cogs/meta/robopage.py 71.40% 🙂 71.59% 🙂 0.19% 👍
cogs/mis/__calc_view.py 81.33% ⭐ 81.34% ⭐ 0.01% 👍
cogs/mis/mis.py 54.64% 🙂 54.94% 🙂 0.30% 👍
cogs/mod/anti_links.py 41.25% 😞 40.77% 😞 -0.48% 👎
cogs/mod/emoji_caps_prot.py 43.21% 😞 45.36% 😞 2.15% 👍
cogs/mod/method.py 51.52% 🙂 51.58% 🙂 0.06% 👍
cogs/mod/mod.py 39.79% 😞 39.87% 😞 0.08% 👍
cogs/mod/spam_prot.py 39.23% 😞 37.99% 😞 -1.24% 👎
cogs/music/music.py 56.41% 🙂 57.23% 🙂 0.82% 👍
cogs/nasa/nasa.py 43.21% 😞 43.43% 😞 0.22% 👍
cogs/owner/fuzzy.py 75.85% ⭐ 76.36% ⭐ 0.51% 👍
cogs/owner/super_owner.py 51.65% 🙂 51.63% 🙂 -0.02% 👎
cogs/rtfm/_doc.py 56.85% 🙂 56.32% 🙂 -0.53% 👎
cogs/rtfm/_ref.py 64.02% 🙂 63.96% 🙂 -0.06% 👎
cogs/rtfm/_tio.py 78.29% ⭐ 78.24% ⭐ -0.05% 👎
cogs/rtfm/_used.py 38.48% 😞 38.27% 😞 -0.21% 👎
cogs/rtfm/rtfm.py 55.17% 🙂 54.85% 🙂 -0.32% 👎
cogs/sector_17/sector_17.py 57.51% 🙂 60.34% 🙂 2.83% 👍
cogs/sports/sports.py 67.02% 🙂 67.55% 🙂 0.53% 👍
cogs/telephone/method.py 10.72% ⛔ 10.74% ⛔ 0.02% 👍
cogs/telephone/telephone.py 62.21% 🙂 61.78% 🙂 -0.43% 👎
cogs/ticket/events.py 24.73% ⛔ 24.48% ⛔ -0.25% 👎
cogs/ticket/method.py 52.41% 🙂 52.99% 🙂 0.58% 👍
cogs/utils/method.py 56.77% 🙂 57.96% 🙂 1.19% 👍
cogs/utils/utils.py 64.63% 🙂 64.62% 🙂 -0.01% 👎
cogs/wolfram/wolfram.py 59.21% 🙂 59.91% 🙂 0.70% 👍
core/Context.py 68.43% 🙂 68.45% 🙂 0.02% 👍
core/Parrot.py 61.26% 🙂 61.49% 🙂 0.23% 👍
discord/ext/ipc/client.py 69.25% 🙂 69.28% 🙂 0.03% 👍
discord/ext/ipc/server.py 70.29% 🙂 72.37% 🙂 2.08% 👍
discord/ext/old_menus/init.py 76.93% ⭐ 76.79% ⭐ -0.14% 👎
events/custom_events.py 62.92% 🙂 63.53% 🙂 0.61% 👍
events/on_cmd.py 27.05% 😞 27.23% 😞 0.18% 👍
events/on_msg.py 49.71% 😞 49.30% 😞 -0.41% 👎
events/on_rexn.py 62.53% 🙂 62.13% 🙂 -0.40% 👎
events/user.py 57.64% 🙂 58.90% 🙂 1.26% 👍
events/guild/channel.py 29.62% 😞 32.71% 😞 3.09% 👍
events/guild/extra.py 44.84% 😞 45.91% 😞 1.07% 👍
events/guild/member.py 51.37% 🙂 51.00% 🙂 -0.37% 👎
events/guild/role_emoji.py 31.93% 😞 33.56% 😞 1.63% 👍
interactions/buttons/__2048.py 78.23% ⭐ 78.38% ⭐ 0.15% 👍
interactions/buttons/__battleship.py 58.18% 🙂 58.82% 🙂 0.64% 👍
interactions/buttons/__chess.py 57.00% 🙂 57.03% 🙂 0.03% 👍
interactions/buttons/__constants.py 51.12% 🙂 51.12% 🙂 0.00%
interactions/buttons/__country_guess.py 64.46% 🙂 64.62% 🙂 0.16% 👍
interactions/buttons/__light_out.py 70.09% 🙂 72.11% 🙂 2.02% 👍
interactions/buttons/__memory_game.py 63.37% 🙂 63.45% 🙂 0.08% 👍
interactions/buttons/__number_slider.py 69.92% 🙂 70.15% 🙂 0.23% 👍
interactions/buttons/__wordle.py 57.69% 🙂 59.45% 🙂 1.76% 👍
interactions/buttons/games.py 66.17% 🙂 66.50% 🙂 0.33% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
cogs/mod/mod.py Moderator.mod 67 ⛔ 1613 ⛔ 1.76% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
cogs/fun/fun.py Fun.quiz_game 64 ⛔ 856 ⛔ 2.13% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
cogs/nasa/nasa.py NASA.nasasearch 50 ⛔ 541 ⛔ 25 ⛔ 5.41% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
events/on_cmd.py Cmd.on_command_error 43 ⛔ 973 ⛔ 24 ⛔ 6.94% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
cogs/mod/emoji_caps_prot.py EmojiCapsProt._on_message_passive 55 ⛔ 437 ⛔ 18 ⛔ 8.84% ⛔ 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!

@rtk-rnjn rtk-rnjn self-assigned this Aug 2, 2022
@rtk-rnjn rtk-rnjn added enhancement New feature or request good first issue Good for newcomers labels Aug 2, 2022
@rtk-rnjn rtk-rnjn merged commit 1447417 into main Aug 2, 2022
@rtk-rnjn rtk-rnjn deleted the sourcery/main branch August 2, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant