hikariatama / Hikka

The most fresh and updateable developer-oriented Telegram userbot
https://hikka.pw
GNU Affero General Public License v3.0
323 stars 527 forks source link

Hikka 1.1.22 (Sourcery refactored) #22

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #20 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 okteto_test branch, then run:

git fetch origin sourcery/okteto_test
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 decrease code quality in the affected files by 0.14%.

Quality metrics Before After Change
Complexity 17.05 🙂 17.10 🙂 0.05 👎
Method Length 72.71 🙂 72.61 🙂 -0.10 👍
Working memory 9.68 🙂 9.71 🙂 0.03 👎
Quality 57.11% 🙂 56.97% 🙂 -0.14% 👎
Other metrics Before After Change
Lines 3247 3261 14
Changed files Quality Before Quality After Quality Change
hikka/loader.py 59.93% 🙂 59.72% 🙂 -0.21% 👎
hikka/utils.py 59.94% 🙂 59.97% 🙂 0.03% 👍
hikka/modules/hikka_security.py 71.18% 🙂 71.22% 🙂 0.04% 👍
hikka/modules/loader.py 44.94% 😞 44.84% 😞 -0.10% 👎
hikka/web/root.py 56.50% 🙂 56.07% 🙂 -0.43% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
hikka/modules/loader.py LoaderMod.load_module 94 ⛔ 908 ⛔ 17 ⛔ 6.66% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/utils.py answer 43 ⛔ 327 ⛔ 14 😞 17.17% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/utils.py smart_split 22 😞 340 ⛔ 15 😞 24.95% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/web/root.py Web.web_auth 18 🙂 317 ⛔ 15 😞 28.38% 😞 Try splitting into smaller methods. Extract out complex expressions
hikka/loader.py Modules.unload_module 25 😞 241 ⛔ 13 😞 29.38% 😞 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!