hikariatama / Hikka

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

V1.2.12 (Sourcery refactored) #51

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

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

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

Quality metrics Before After Change
Complexity 18.92 😞 18.87 😞 -0.05 👍
Method Length 87.05 🙂 87.02 🙂 -0.03 👍
Working memory 6.97 🙂 7.00 🙂 0.03 👎
Quality 54.61% 🙂 54.54% 🙂 -0.07% 👎
Other metrics Before After Change
Lines 1385 1375 -10
Changed files Quality Before Quality After Quality Change
hikka/forbid_joins.py 63.87% 🙂 66.26% 🙂 2.39% 👍
hikka/loader.py 53.18% 🙂 53.02% 🙂 -0.16% 👎
hikka/inline/bot_pm.py 82.50% ⭐ 82.50% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
hikka/loader.py Modules.unload_module 35 ⛔ 297 ⛔ 16 ⛔ 18.25% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/loader.py Modules.register_commands 29 😞 344 ⛔ 10 😞 28.64% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/loader.py replace_all_refs 67 ⛔ 298 ⛔ 38.05% 😞 Refactor to reduce nesting. Try splitting into smaller methods
hikka/loader.py Modules.send_ready_one 21 😞 236 ⛔ 9 🙂 39.49% 😞 Refactor to reduce nesting. Try splitting into smaller methods
hikka/loader.py Modules._request_join 9 🙂 258 ⛔ 13 😞 40.90% 😞 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!