japandotorg / Seina-Cogs

My public cogs for red.
https://seina-cogs.readthedocs.io/en/latest/
Other
13 stars 18 forks source link

Tracking (Discord.py 2.1.0 Support) (Sourcery refactored) #15

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #11 refactored by Sourcery.

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

NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

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

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

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.09%.

Quality metrics Before After Change
Complexity 8.74 🙂 8.62 🙂 -0.12 👍
Method Length 77.42 🙂 77.31 🙂 -0.11 👍
Working memory 9.74 🙂 9.83 🙂 0.09 👎
Quality 60.90% 🙂 60.81% 🙂 -0.09% 👎
Other metrics Before After Change
Lines 2271 2254 -17
Changed files Quality Before Quality After Quality Change
.utils/utils.py 42.80% 😞 43.23% 😞 0.43% 👍
calculator/core.py 60.96% 🙂 60.96% 🙂 0.00%
chemistry/core.py 77.76% ⭐ 77.76% ⭐ 0.00%
epicgames/core.py 47.71% 😞 47.71% 😞 0.00%
epicgames/utils.py 96.92% ⭐ 99.28% ⭐ 2.36% 👍
globalban/core.py 65.22% 🙂 65.21% 🙂 -0.01% 👎
maplestory/core.py 81.15% ⭐ 71.96% 🙂 -9.19% 👎
modnotes/core.py 78.87% ⭐ 78.84% ⭐ -0.03% 👎
modnotes/utils/cog_settings.py 68.25% 🙂 68.43% 🙂 0.18% 👍
msgutils/core.py 76.05% ⭐ 76.05% ⭐ 0.00%
rainbowrole/core.py 82.02% ⭐ 81.39% ⭐ -0.63% 👎
seinatools/core.py 55.06% 🙂 55.62% 🙂 0.56% 👍
statuscodes/core.py 56.36% 🙂 56.36% 🙂 0.00%
userpreferences/core.py 79.89% ⭐ 79.89% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
seinatools/core.py SeinaTools._spy 26 😞 526 ⛔ 24 ⛔ 14.19% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
epicgames/core.py EpicGames._epic_games 27 😞 251 ⛔ 16 ⛔ 23.91% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
globalban/core.py GlobalBan.update_gbs 26 😞 248 ⛔ 13 😞 28.42% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
.utils/utils.py make 7 ⭐ 392 ⛔ 26 ⛔ 29.51% 😞 Try splitting into smaller methods. Extract out complex expressions
.utils/utils.py countlines 26 😞 281 ⛔ 11 😞 30.24% 😞 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!