japandotorg / Seina-Cogs

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

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

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.47%.

Quality metrics Before After Change
Complexity 5.65 ⭐ 5.64 ⭐ -0.01 👍
Method Length 64.43 🙂 64.34 🙂 -0.09 👍
Working memory 8.82 🙂 9.04 🙂 0.22 👎
Quality 68.30% 🙂 67.83% 🙂 -0.47% 👎
Other metrics Before After Change
Lines 1915 1891 -24
Changed files Quality Before Quality After Quality Change
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% 👍
github/core.py 59.94% 🙂 59.36% 🙂 -0.58% 👎
globaladmin/core.py 83.77% ⭐ 83.33% ⭐ -0.44% 👎
globalban/core.py 65.76% 🙂 65.62% 🙂 -0.14% 👎
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% 👍
rainbowrole/core.py 81.10% ⭐ 80.38% ⭐ -0.72% 👎
seinatools/core.py 53.11% 🙂 53.20% 🙂 0.09% 👍
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
github/core.py Github.fetch_issue 15 🙂 195 😞 13 😞 39.53% 😞 Try splitting into smaller methods. Extract out complex expressions
calculator/core.py Calculator.calc 5 ⭐ 258 ⛔ 13 😞 44.72% 😞 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!