starlightknown / Cyberon

Cyberon- a discord bot for hackathon servers made by using discord.py
https://starlightknown.github.io/Cyberon/#/
MIT License
19 stars 12 forks source link

Sourcery refactored main branch #84

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

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[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 37.88 ⛔ 32.71 ⛔ -5.17 👍
Method Length 118.60 🙂 115.79 🙂 -2.81 👍
Working memory 16.32 ⛔ 15.55 ⛔ -0.77 👍
Quality 35.57% 😞 37.36% 😞 1.79% 👍
Other metrics Before After Change
Lines 3885 3657 -228
Changed files Quality Before Quality After Quality Change
bot.py 64.89% 🙂 67.94% 🙂 3.05% 👍
cogs/Config.py 32.20% 😞 33.10% 😞 0.90% 👍
cogs/Fun.py 62.82% 🙂 63.18% 🙂 0.36% 👍
cogs/Help.py 47.81% 😞 52.72% 🙂 4.91% 👍
cogs/Moderation.py 15.56% ⛔ 16.62% ⛔ 1.06% 👍
cogs/Utils.py 54.11% 🙂 55.98% 🙂 1.87% 👍
cogs/usefullTools/dbIntegration.py 59.71% 🙂 62.86% 🙂 3.15% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
cogs/Config.py ConfigCog.server_config 68 ⛔ 865 ⛔ 32 ⛔ 1.76% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
cogs/Moderation.py ModerationCog.mute 93 ⛔ 561 ⛔ 25 ⛔ 2.44% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
cogs/Moderation.py ModerationCog.warn 80 ⛔ 557 ⛔ 26 ⛔ 2.46% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
cogs/Moderation.py ModerationCog.multiban 75 ⛔ 412 ⛔ 21 ⛔ 5.45% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
cogs/Moderation.py ModerationCog.purgerole 69 ⛔ 421 ⛔ 21 ⛔ 5.66% ⛔ 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:

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!