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.2 (Sourcery refactored) #99

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #98 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.2 branch, then run:

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

Quality metrics Before After Change
Complexity 11.86 🙂 11.72 🙂 -0.14 👍
Method Length 83.90 🙂 83.94 🙂 0.04 👎
Working memory 8.07 🙂 8.16 🙂 0.09 👎
Quality 58.74% 🙂 58.69% 🙂 -0.05% 👎
Other metrics Before After Change
Lines 10520 10458 -62
Changed files Quality Before Quality After Quality Change
hikka/_local_storage.py 74.62% 🙂 74.62% 🙂 0.00%
hikka/configurator.py 56.55% 🙂 57.35% 🙂 0.80% 👍
hikka/dispatcher.py 30.67% 😞 31.04% 😞 0.37% 👍
hikka/loader.py 62.61% 🙂 62.65% 🙂 0.04% 👍
hikka/main.py 58.63% 🙂 58.46% 🙂 -0.17% 👎
hikka/types.py 66.44% 🙂 66.56% 🙂 0.12% 👍
hikka/utils.py 58.37% 🙂 58.75% 🙂 0.38% 👍
hikka/validators.py 69.50% 🙂 69.82% 🙂 0.32% 👍
hikka/compat/dragon.py 80.63% ⭐ 80.62% ⭐ -0.01% 👎
hikka/compat/pyroproxy.py 76.33% ⭐ 75.89% ⭐ -0.44% 👎
hikka/modules/api_protection.py 63.19% 🙂 63.21% 🙂 0.02% 👍
hikka/modules/help.py 24.65% ⛔ 23.86% ⛔ -0.79% 👎
hikka/modules/hikka_config.py 51.14% 🙂 51.01% 🙂 -0.13% 👎
hikka/modules/hikka_info.py 57.15% 🙂 57.13% 🙂 -0.02% 👎
hikka/modules/hikka_security.py 50.28% 🙂 50.24% 🙂 -0.04% 👎
hikka/modules/hikka_settings.py 50.66% 🙂 50.01% 🙂 -0.65% 👎
hikka/modules/update_notifier.py 74.63% 🙂 72.02% 🙂 -2.61% 👎
hikka/web/proxypass.py 72.26% 🙂 73.01% 🙂 0.75% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
hikka/dispatcher.py CommandDispatcher._handle_command 57 ⛔ 732 ⛔ 27 ⛔ 3.56% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/main.py Hikka._initial_setup 57 ⛔ 416 ⛔ 4.86% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/dispatcher.py CommandDispatcher._handle_tags 53 ⛔ 639 ⛔ 24 ⛔ 5.02% ⛔ 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/modules/help.py HelpMod.help 52 ⛔ 577 ⛔ 21 ⛔ 6.59% ⛔ 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!