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 (Sourcery refactored) #72

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #71 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/GeekTG/Friendly-Telegram pull/71/head
    git merge --ff-only FETCH_HEAD
    git push

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:

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.01%.

Quality metrics Before After Change
Complexity 17.02 🙂 17.02 🙂 0.00
Method Length 66.61 🙂 66.52 🙂 -0.09 👍
Working memory 8.62 🙂 8.63 🙂 0.01 👎
Quality 60.26% 🙂 60.25% 🙂 -0.01% 👎
Other metrics Before After Change
Lines 2434 2442 8
Changed files Quality Before Quality After Quality Change
friendly-telegram/configurator.py 76.09% ⭐ 76.09% ⭐ 0.00%
friendly-telegram/compat/raphielgang.py 57.43% 🙂 57.44% 🙂 0.01% 👍
friendly-telegram/modules/corectrl.py 76.44% ⭐ 76.46% ⭐ 0.02% 👍
friendly-telegram/modules/geek_security.py 73.59% 🙂 73.62% 🙂 0.03% 👍
friendly-telegram/modules/geek_settings.py 56.21% 🙂 56.27% 🙂 0.06% 👍
friendly-telegram/modules/loader.py 49.30% 😞 49.19% 😞 -0.11% 👎
friendly-telegram/translations/core.py 40.34% 😞 40.30% 😞 -0.04% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
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
friendly-telegram/translations/core.py Translator.init 43 ⛔ 250 ⛔ 14 😞 20.03% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/compat/raphielgang.py RaphielgangEvents.RaphielgangEventsSub.register 36 ⛔ 297 ⛔ 10 😞 26.87% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/geek_settings.py GeekSettingsMod.watchercmd 22 😞 309 ⛔ 12 😞 30.02% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/compat/raphielgang.py RaphielgangEvents.RaphielgangEventsSub.register.subreg 26 😞 259 ⛔ 10 😞 33.08% 😞 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!