TeamPGM / PagerMaid-Pyro

Advanced Multi-Featured Telegram UserBot by pyrogram.
GNU Affero General Public License v3.0
646 stars 81 forks source link

Sourcery refactored master branch #15

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

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 master branch, then run:

git fetch origin sourcery/master
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.28%.

Quality metrics Before After Change
Complexity 25.53 😞 24.91 😞 -0.62 👍
Method Length 88.62 🙂 88.26 🙂 -0.36 👍
Working memory 12.09 😞 12.15 😞 0.06 👎
Quality 47.62% 😞 47.34% 😞 -0.28% 👎
Other metrics Before After Change
Lines 2084 2063 -21
Changed files Quality Before Quality After Quality Change
pagermaid/main.py 72.32% 🙂 72.10% 🙂 -0.22% 👎
pagermaid/group_manager.py 80.62% ⭐ 81.18% ⭐ 0.56% 👍
pagermaid/listener.py 15.38% ⛔ 15.75% ⛔ 0.37% 👍
pagermaid/utils.py 78.51% ⭐ 77.66% ⭐ -0.85% 👎
pagermaid/modules/init.py 78.97% ⭐ 81.24% ⭐ 2.27% 👍
pagermaid/modules/avoid.py 50.83% 🙂 50.64% 🙂 -0.19% 👎
pagermaid/modules/backup.py 70.08% 🙂 72.87% 🙂 2.79% 👍
pagermaid/modules/help.py 40.74% 😞 41.92% 😞 1.18% 👍
pagermaid/modules/message.py 37.09% 😞 36.46% 😞 -0.63% 👎
pagermaid/modules/prune.py 50.12% 🙂 49.77% 😞 -0.35% 👎
pagermaid/modules/status.py 67.35% 🙂 67.65% 🙂 0.30% 👍
pagermaid/modules/sudo.py 8.54% ⛔ 8.10% ⛔ -0.44% 👎
pagermaid/modules/system.py 57.58% 🙂 57.54% 🙂 -0.04% 👎
pyromod/listen/listen.py 66.00% 🙂 67.67% 🙂 1.67% 👍
pyromod/nav/pagination.py 30.97% 😞 32.03% 😞 1.06% 👍
pyromod/utils/utils.py 89.94% ⭐ 89.82% ⭐ -0.12% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
pagermaid/listener.py listener 90 ⛔ 715 ⛔ 21 ⛔ 3.90% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pagermaid/modules/sudo.py sudo_change 78 ⛔ 726 ⛔ 21 ⛔ 4.21% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pagermaid/listener.py listener.decorator 42 ⛔ 304 ⛔ 21 ⛔ 11.86% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pagermaid/modules/message.py userid 52 ⛔ 393 ⛔ 10 😞 20.64% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pagermaid/listener.py listener.decorator.handler 24 😞 252 ⛔ 21 ⛔ 21.76% ⛔ 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!