GeekTG / Friendly-Telegram

Best Telegram userbot with inline buttons support
https://ftg.geektg.ml
GNU Affero General Public License v3.0
83 stars 60 forks source link

Update #71

Closed rodion-gudz closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 3.63%.

Quality metrics Before After Change
Complexity 16.50 🙂 25.28 😞 8.78 👎
Method Length 56.15 ⭐ 58.61 ⭐ 2.46 👎
Working memory 9.01 🙂 10.10 😞 1.09 👎
Quality 61.68% 🙂 58.05% 🙂 -3.63% 👎
Other metrics Before After Change
Lines 5845 6705 860
Changed files Quality Before Quality After Quality Change
friendly-telegram/main.py 77.40% ⭐ 47.83% 😞 -29.57% 👎
friendly-telegram/configurator.py 76.95% ⭐ 76.09% ⭐ -0.86% 👎
friendly-telegram/dispatcher.py 34.48% 😞 25.04% 😞 -9.44% 👎
friendly-telegram/heroku.py 62.30% 🙂 62.30% 🙂 0.00%
friendly-telegram/loader.py 72.74% 🙂 66.16% 🙂 -6.58% 👎
friendly-telegram/log.py 83.92% ⭐ 83.27% ⭐ -0.65% 👎
friendly-telegram/main.py 32.15% 😞 31.98% 😞 -0.17% 👎
friendly-telegram/security.py 42.61% 😞 42.56% 😞 -0.05% 👎
friendly-telegram/utils.py 55.84% 🙂 62.96% 🙂 7.12% 👍
friendly-telegram/compat/init.py 93.39% ⭐ 93.41% ⭐ 0.02% 👍
friendly-telegram/compat/dbhelper.py 92.68% ⭐ 92.59% ⭐ -0.09% 👎
friendly-telegram/compat/raphielgang.py 57.43% 🙂 57.43% 🙂 0.00%
friendly-telegram/compat/uniborg.py 58.38% 🙂 57.92% 🙂 -0.46% 👎
friendly-telegram/compat/util.py 81.12% ⭐ 81.12% ⭐ 0.00%
friendly-telegram/database/backend.py 67.93% 🙂 61.90% 🙂 -6.03% 👎
friendly-telegram/database/frontend.py 86.30% ⭐ 87.49% ⭐ 1.19% 👍
friendly-telegram/modules/backuper.py 76.77% ⭐ 76.73% ⭐ -0.04% 👎
friendly-telegram/modules/corectrl.py 72.45% 🙂 76.44% ⭐ 3.99% 👍
friendly-telegram/modules/help.py 29.78% 😞 21.97% ⛔ -7.81% 👎
friendly-telegram/modules/loader.py 61.78% 🙂 49.30% 😞 -12.48% 👎
friendly-telegram/modules/nocollisions.py 77.55% ⭐ 75.15% ⭐ -2.40% 👎
friendly-telegram/modules/python.py 71.75% 🙂 82.61% ⭐ 10.86% 👍
friendly-telegram/modules/raphielgang_config.py 91.25% ⭐ 91.25% ⭐ 0.00%
friendly-telegram/modules/test.py 73.79% 🙂 45.59% 😞 -28.20% 👎
friendly-telegram/modules/uniborg_config.py 89.79% ⭐ 89.79% ⭐ 0.00%
friendly-telegram/modules/updater.py 67.14% 🙂 72.29% 🙂 5.15% 👍
friendly-telegram/translations/core.py 40.34% 😞 40.34% 😞 0.00%
friendly-telegram/translations/dynamic.py 88.38% ⭐ 88.31% ⭐ -0.07% 👎
friendly-telegram/web/core.py 52.28% 🙂 84.37% ⭐ 32.09% 👍
friendly-telegram/web/initial_setup.py 61.20% 🙂 65.07% 🙂 3.87% 👍
friendly-telegram/web/root.py 85.76% ⭐ 89.98% ⭐ 4.22% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
friendly-telegram/dispatcher.py CommandDispatcher.handle_command 178 ⛔ 1077 ⛔ 24 ⛔ 2.24% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/security.py SecurityManager._check 88 ⛔ 398 ⛔ 28 ⛔ 2.89% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/main.py main 110 ⛔ 789 ⛔ 22 ⛔ 3.16% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/help.py HelpMod.helpcmd 93 ⛔ 762 ⛔ 20 ⛔ 4.41% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/loader.py LoaderMod.load_module 96 ⛔ 829 ⛔ 18 ⛔ 5.77% ⛔ 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!