Skip to content

change all like this to work logomaker properly (Sourcery refactored)#189

Open
sourcery-ai[bot] wants to merge 3 commits into
Rajkumarfrom
sourcery/pull-188
Open

change all like this to work logomaker properly (Sourcery refactored)#189
sourcery-ai[bot] wants to merge 3 commits into
Rajkumarfrom
sourcery/pull-188

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented Dec 20, 2022

Copy link
Copy Markdown

Pull Request #188 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/Awesome-RJ/CutiepiiRobot pull/188/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!

Comment on lines -1271 to +1273
if event.sender_id == OWNER_ID:
pass
else:

if not quew:
await event.reply("Please Gimmie A Text For The Logo.")
return
if event.sender_id != OWNER_ID and not quew:
await event.reply("Please Gimmie A Text For The Logo.")
return

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function lego refactored with the following changes:

@sourcery-ai

sourcery-ai Bot commented Dec 20, 2022

Copy link
Copy Markdown
Author

Sourcery Code Quality Report

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 21.56 😞 21.56 😞 0.00
Method Length 109.88 🙂 109.88 🙂 0.00
Working memory 14.85 😞 14.85 😞 0.00
Quality 49.59% 😞 49.59% 😞 0.00%
Other metrics Before After Change
Lines 25064 24990 -74
Changed files Quality Before Quality After Quality Change
string_generator.py 88.29% ⭐ 88.29% ⭐ 0.00%
Cutiepii_Robot/__init__.py 16.54% ⛔ 16.54% ⛔ 0.00%
Cutiepii_Robot/__main__.py 51.57% 🙂 51.57% 🙂 0.00%
Cutiepii_Robot/modules/admin.py 41.36% 😞 41.36% 😞 0.00%
Cutiepii_Robot/modules/antichannel.py 65.14% 🙂 65.14% 🙂 0.00%
Cutiepii_Robot/modules/antiflood.py 33.83% 😞 33.83% 😞 0.00%
Cutiepii_Robot/modules/antilinkedchannel.py 66.16% 🙂 66.16% 🙂 0.00%
Cutiepii_Robot/modules/approve.py 55.05% 🙂 55.05% 🙂 0.00%
Cutiepii_Robot/modules/backups.py 23.46% ⛔ 23.46% ⛔ 0.00%
Cutiepii_Robot/modules/bans.py 33.93% 😞 33.93% 😞 0.00%
Cutiepii_Robot/modules/blacklist.py 28.47% 😞 28.47% 😞 0.00%
Cutiepii_Robot/modules/blacklist_stickers.py 25.39% 😞 25.39% 😞 0.00%
Cutiepii_Robot/modules/chatbot.py 67.79% 🙂 67.79% 🙂 0.00%
Cutiepii_Robot/modules/cleaner.py 62.28% 🙂 62.28% 🙂 0.00%
Cutiepii_Robot/modules/connection.py 32.09% 😞 32.09% 😞 0.00%
Cutiepii_Robot/modules/covid.py 49.45% 😞 49.45% 😞 0.00%
Cutiepii_Robot/modules/cust_filters.py 31.69% 😞 31.69% 😞 0.00%
Cutiepii_Robot/modules/dev.py 77.65% ⭐ 77.65% ⭐ 0.00%
Cutiepii_Robot/modules/disable.py 56.01% 🙂 56.01% 🙂 0.00%
Cutiepii_Robot/modules/disasters_new.py 62.61% 🙂 62.61% 🙂 0.00%
Cutiepii_Robot/modules/drama.py 36.83% 😞 36.83% 😞 0.00%
Cutiepii_Robot/modules/error_handling.py 61.29% 🙂 61.29% 🙂 0.00%
Cutiepii_Robot/modules/eval.py 60.28% 🙂 60.28% 🙂 0.00%
Cutiepii_Robot/modules/fun.py 64.77% 🙂 64.77% 🙂 0.00%
Cutiepii_Robot/modules/get_common_chats.py 60.41% 🙂 60.41% 🙂 0.00%
Cutiepii_Robot/modules/github_all.py 68.00% 🙂 68.00% 🙂 0.00%
Cutiepii_Robot/modules/global_bans.py 35.87% 😞 35.87% 😞 0.00%
Cutiepii_Robot/modules/gtranslator.py 66.07% 🙂 66.07% 🙂 0.00%
Cutiepii_Robot/modules/inlinebot.py 5.55% ⛔ 5.55% ⛔ 0.00%
Cutiepii_Robot/modules/lewd.py 77.58% ⭐ 77.58% ⭐ 0.00%
Cutiepii_Robot/modules/log_channel.py 63.41% 🙂 63.41% 🙂 0.00%
Cutiepii_Robot/modules/logomaker.py 45.79% 😞 47.76% 😞 1.97% 👍
Cutiepii_Robot/modules/mentionall.py 43.13% 😞 43.13% 😞 0.00%
Cutiepii_Robot/modules/misc.py 52.04% 🙂 52.04% 🙂 0.00%
Cutiepii_Robot/modules/muting.py 35.91% 😞 35.91% 😞 0.00%
Cutiepii_Robot/modules/notes.py 35.37% 😞 35.37% 😞 0.00%
Cutiepii_Robot/modules/private_notes.py 63.82% 🙂 63.82% 🙂 0.00%
Cutiepii_Robot/modules/purge.py 55.22% 🙂 55.22% 🙂 0.00%
Cutiepii_Robot/modules/raid.py 52.70% 🙂 52.70% 🙂 0.00%
Cutiepii_Robot/modules/reminders.py 52.39% 🙂 52.39% 🙂 0.00%
Cutiepii_Robot/modules/remote_cmds.py 38.20% 😞 38.20% 😞 0.00%
Cutiepii_Robot/modules/reporting.py 41.32% 😞 41.32% 😞 0.00%
Cutiepii_Robot/modules/rules.py 68.81% 🙂 68.81% 🙂 0.00%
Cutiepii_Robot/modules/stickers.py 31.71% 😞 31.71% 😞 0.00%
Cutiepii_Robot/modules/upload.py 61.27% 🙂 61.27% 🙂 0.00%
Cutiepii_Robot/modules/userinfo.py 47.06% 😞 47.06% 😞 0.00%
Cutiepii_Robot/modules/users.py 61.69% 🙂 61.69% 🙂 0.00%
Cutiepii_Robot/modules/wallpaper.py 53.71% 🙂 53.71% 🙂 0.00%
Cutiepii_Robot/modules/warns.py 42.02% 😞 42.02% 😞 0.00%
Cutiepii_Robot/modules/welcome.py 27.09% 😞 27.09% 😞 0.00%
Cutiepii_Robot/modules/whisper.py 72.76% 🙂 72.76% 🙂 0.00%
Cutiepii_Robot/modules/wiki.py 57.33% 🙂 57.33% 🙂 0.00%
Cutiepii_Robot/modules/sql/antilinkedchannel_sql.py 87.03% ⭐ 87.03% ⭐ 0.00%
Cutiepii_Robot/modules/sql/blacklistusers_sql.py 89.05% ⭐ 89.05% ⭐ 0.00%
Cutiepii_Robot/modules/sql/blsticker_sql.py 85.79% ⭐ 85.79% ⭐ 0.00%
Cutiepii_Robot/modules/sql/cleaner_sql.py 79.64% ⭐ 79.64% ⭐ 0.00%
Cutiepii_Robot/modules/sql/cust_filters_sql.py 68.56% 🙂 68.56% 🙂 0.00%
Cutiepii_Robot/modules/sql/disable_sql.py 85.33% ⭐ 85.33% ⭐ 0.00%
Cutiepii_Robot/modules/sql/feds_sql.py 71.47% 🙂 71.47% 🙂 0.00%
Cutiepii_Robot/modules/sql/forceSubscribe_sql.py 89.46% ⭐ 89.46% ⭐ 0.00%
Cutiepii_Robot/modules/sql/github_sql.py 85.72% ⭐ 85.72% ⭐ 0.00%
Cutiepii_Robot/modules/sql/global_bans_sql.py 88.09% ⭐ 88.09% ⭐ 0.00%
Cutiepii_Robot/modules/sql/logger_sql.py 88.02% ⭐ 88.02% ⭐ 0.00%
Cutiepii_Robot/modules/sql/nsfw_sql.py 92.39% ⭐ 92.39% ⭐ 0.00%
Cutiepii_Robot/modules/sql/private_notes.py 87.23% ⭐ 87.23% ⭐ 0.00%
Cutiepii_Robot/modules/sql/remind_sql.py 79.22% ⭐ 79.22% ⭐ 0.00%
Cutiepii_Robot/modules/sql/reporting_sql.py 89.06% ⭐ 89.06% ⭐ 0.00%
Cutiepii_Robot/modules/sql/warns_sql.py 82.65% ⭐ 82.65% ⭐ 0.00%
Cutiepii_Robot/modules/sql/welcome_sql.py 80.37% ⭐ 80.37% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
Cutiepii_Robot/modules/inlinebot.py inline_query_handler 144 ⛔ 4047 ⛔ 75 ⛔ 0.01% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cutiepii_Robot/modules/welcome.py new_member 145 ⛔ 1596 ⛔ 34 ⛔ 0.48% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cutiepii_Robot/modules/stickers.py kang 153 ⛔ 1622 ⛔ 32 ⛔ 0.64% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cutiepii_Robot/modules/userinfo.py info 71 ⛔ 819 ⛔ 24 ⛔ 3.19% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cutiepii_Robot/modules/cust_filters.py reply_filter 112 ⛔ 770 ⛔ 21 ⛔ 3.66% ⛔ 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:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants