flaree / flare-cogs

Various cogs written for Red-DiscordBot
MIT License
76 stars 69 forks source link

Sourcery refactored master branch #146

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

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

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

Help us improve this pull request!

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 26.11 😞 24.78 😞 -1.33 👍
Method Length 107.06 🙂 106.61 🙂 -0.45 👍
Working memory 12.31 😞 12.49 😞 0.18 👎
Quality 41.59% 😞 41.79% 😞 0.20% 👍
Other metrics Before After Change
Lines 740 742 2
Changed files Quality Before Quality After Quality Change
giveaways/converter.py 23.57% ⛔ 23.79% ⛔ 0.22% 👍
giveaways/giveaways.py 52.30% 🙂 51.90% 🙂 -0.40% 👎
giveaways/objects.py 38.04% 😞 39.56% 😞 1.52% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
giveaways/objects.py Giveaway.add_entrant 50 ⛔ 576 ⛔ 17 ⛔ 9.81% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
giveaways/giveaways.py Giveaways.draw_winner 31 😞 347 ⛔ 28 ⛔ 12.40% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
giveaways/converter.py Args.convert 47 ⛔ 718 ⛔ 9 🙂 22.26% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
giveaways/giveaways.py Giveaways.advanced 10 🙂 226 ⛔ 17 ⛔ 36.93% 😞 Try splitting into smaller methods. Extract out complex expressions
giveaways/giveaways.py Giveaways.init 9 🙂 120 😞 16 ⛔ 48.60% 😞 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!