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.4.1 #68

Closed hikariatama closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.51%.

Quality metrics Before After Change
Complexity 24.20 😞 23.70 😞 -0.50 👍
Method Length 106.11 🙂 105.99 🙂 -0.12 👍
Working memory 7.96 🙂 8.23 🙂 0.27 👎
Quality 48.53% 😞 49.04% 😞 0.51% 👍
Other metrics Before After Change
Lines 15399 15486 87
Changed files Quality Before Quality After Quality Change
hikka/main.py 62.73% 🙂 62.73% 🙂 0.00%
hikka/database.py 71.01% 🙂 71.01% 🙂 0.00%
hikka/dispatcher.py 32.16% 😞 32.16% 😞 0.00%
hikka/heroku.py 70.03% 🙂 70.03% 🙂 0.00%
hikka/loader.py 43.25% 😞 43.25% 😞 0.00%
hikka/log.py 53.82% 🙂 53.78% 🙂 -0.04% 👎
hikka/main.py 68.09% 🙂 68.37% 🙂 0.28% 👍
hikka/security.py 40.70% 😞 40.51% 😞 -0.19% 👎
hikka/tl_cache.py 41.08% 😞 41.13% 😞 0.05% 👍
hikka/types.py 76.32% ⭐ 81.29% ⭐ 4.97% 👍
hikka/utils.py 57.11% 🙂 56.71% 🙂 -0.40% 👎
hikka/validators.py 71.28% 🙂 69.77% 🙂 -1.51% 👎
hikka/version.py 100.00% ⭐ 86.81% ⭐ -13.19% 👎
hikka/inline/core.py 47.78% 😞 47.77% 😞 -0.01% 👎
hikka/inline/form.py 5.74% ⛔ 5.74% ⛔ 0.00%
hikka/inline/gallery.py 35.25% 😞 35.26% 😞 0.01% 👍
hikka/inline/list.py 18.39% ⛔ 18.39% ⛔ 0.00%
hikka/inline/query_gallery.py 18.50% ⛔ 18.50% ⛔ 0.00%
hikka/inline/utils.py 30.26% 😞 30.28% 😞 0.02% 👍
hikka/modules/api_protection.py 66.90% 🙂 66.90% 🙂 0.00%
hikka/modules/help.py 21.19% ⛔ 21.19% ⛔ 0.00%
hikka/modules/heroku_waker.py 81.73% ⭐ 81.73% ⭐ 0.00%
hikka/modules/hikka_config.py 47.67% 😞 47.69% 😞 0.02% 👍
hikka/modules/hikka_info.py 66.17% 🙂 65.32% 🙂 -0.85% 👎
hikka/modules/hikka_security.py 54.76% 🙂 54.68% 🙂 -0.08% 👎
hikka/modules/hikka_settings.py 54.91% 🙂 54.91% 🙂 0.00%
hikka/modules/inline_stuff.py 62.96% 🙂 62.90% 🙂 -0.06% 👎
hikka/modules/loader.py 32.21% 😞 32.23% 😞 0.02% 👍
hikka/modules/presets.py 78.79% ⭐ 78.79% ⭐ 0.00%
hikka/modules/python.py 51.80% 🙂 51.80% 🙂 0.00%
hikka/modules/settings.py 74.48% 🙂 74.27% 🙂 -0.21% 👎
hikka/modules/test.py 39.91% 😞 39.91% 😞 0.00%
hikka/modules/update_notifier.py 73.72% 🙂 73.50% 🙂 -0.22% 👎
hikka/modules/updater.py 51.75% 🙂 51.71% 🙂 -0.04% 👎
hikka/web/core.py 76.72% ⭐ 76.72% ⭐ 0.00%
hikka/web/root.py 53.99% 🙂 54.00% 🙂 0.01% 👍

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 153 ⛔ 1916 ⛔ 0.01% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/inline/form.py Form.form 87 ⛔ 1019 ⛔ 0.54% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/inline/gallery.py Gallery.gallery 78 ⛔ 882 ⛔ 0.94% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
hikka/security.py SecurityManager._check 110 ⛔ 753 ⛔ 27 ⛔ 1.53% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hikka/inline/list.py List.list 55 ⛔ 678 ⛔ 3.68% ⛔ Refactor to reduce nesting. Try splitting into smaller methods

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!