hikariatama / Hikka

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

V1.6.1 (Sourcery refactored) #92

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #91 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 v1.6.1 branch, then run:

git fetch origin sourcery/v1.6.1
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.13%.

Quality metrics Before After Change
Complexity 12.66 🙂 12.51 🙂 -0.15 👍
Method Length 87.64 🙂 87.73 🙂 0.09 👎
Working memory 8.28 🙂 8.49 🙂 0.21 👎
Quality 57.42% 🙂 57.29% 🙂 -0.13% 👎
Other metrics Before After Change
Lines 9943 9826 -117
Changed files Quality Before Quality After Quality Change
hikka/configurator.py 79.61% ⭐ 79.63% ⭐ 0.02% 👍
hikka/dispatcher.py 32.04% 😞 32.41% 😞 0.37% 👍
hikka/loader.py 62.58% 🙂 62.62% 🙂 0.04% 👍
hikka/types.py 66.52% 🙂 66.64% 🙂 0.12% 👍
hikka/utils.py 58.15% 🙂 58.60% 🙂 0.45% 👍
hikka/validators.py 52.37% 🙂 52.49% 🙂 0.12% 👍
hikka/compat/dragon.py 81.53% ⭐ 81.53% ⭐ 0.00%
hikka/compat/pyroproxy.py 76.37% ⭐ 75.94% ⭐ -0.43% 👎
hikka/modules/help.py 20.92% ⛔ 19.12% ⛔ -1.80% 👎
hikka/modules/hikka_backup.py 69.38% 🙂 67.48% 🙂 -1.90% 👎
hikka/modules/hikka_config.py 50.73% 🙂 50.60% 🙂 -0.13% 👎
hikka/modules/hikka_info.py 56.78% 🙂 56.77% 🙂 -0.01% 👎
hikka/modules/hikka_security.py 55.24% 🙂 54.75% 🙂 -0.49% 👎
hikka/modules/hikka_settings.py 49.95% 😞 49.30% 😞 -0.65% 👎
hikka/modules/python.py 61.30% 🙂 61.62% 🙂 0.32% 👍
hikka/modules/update_notifier.py 74.09% 🙂 71.44% 🙂 -2.65% 👎
hikka/web/proxypass.py 73.68% 🙂 74.38% 🙂 0.70% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
hikka/modules/help.py HelpMod.help 67 ⛔ 715 ⛔ 24 ⛔ 3.47% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/types.py Module.import_lib 49 ⛔ 722 ⛔ 5.10% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/dispatcher.py CommandDispatcher._handle_command 46 ⛔ 670 ⛔ 27 ⛔ 5.46% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/utils.py answer 60 ⛔ 528 ⛔ 16 ⛔ 9.55% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/dispatcher.py CommandDispatcher._handle_tags 37 ⛔ 452 ⛔ 24 ⛔ 9.56% ⛔ 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!