Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beautified the code (Sourcery refactored) #13

Closed
wants to merge 3 commits into from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Sep 18, 2021

Pull Request #12 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/lostb053/anibot pull/12/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
Copy link
Author

sourcery-ai bot commented Sep 18, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 23.98 😞 23.08 😞 -0.90 👍
Method Length 173.47 😞 166.86 😞 -6.61 👍
Working memory 15.82 ⛔ 15.44 ⛔ -0.38 👍
Quality 36.82% 😞 37.77% 😞 0.95% 👍
Other metrics Before After Change
Lines 3724 4098 374
Changed files Quality Before Quality After Quality Change
anibot/main.py 94.66% ⭐ 94.66% ⭐ 0.00%
anibot/plugins/anilist.py 40.13% 😞 40.79% 😞 0.66% 👍
anibot/plugins/animefillerslist.py 54.10% 🙂 54.10% 🙂 0.00%
anibot/plugins/animequotes.py 76.64% ⭐ 76.64% ⭐ 0.00%
anibot/plugins/bot.py 26.91% 😞 27.26% 😞 0.35% 👍
anibot/plugins/jikan.py 76.67% ⭐ 76.67% ⭐ 0.00%
anibot/plugins/livechartme.py 10.94% ⛔ 11.52% ⛔ 0.58% 👍
anibot/plugins/tracemoepy.py 29.47% 😞 29.49% 😞 0.02% 👍
anibot/plugins/watch.py 56.43% 🙂 55.20% 🙂 -1.23% 👎
anibot/utils/data_parser.py 34.78% 😞 36.74% 😞 1.96% 👍
anibot/utils/db.py 90.65% ⭐ 90.65% ⭐ 0.00%
anibot/utils/helper.py 48.63% 😞 49.89% 😞 1.26% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
anibot/plugins/livechartme.py livechart_parser 82 ⛔ 1238 ⛔ 25 ⛔ 2.40% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
anibot/plugins/bot.py en_dis__able_cmd 63 ⛔ 380 ⛔ 23 ⛔ 5.71% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
anibot/plugins/anilist.py additional_info_btn 41 ⛔ 547 ⛔ 24 ⛔ 7.79% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
anibot/utils/data_parser.py get_anilist 34 ⛔ 613 ⛔ 29 ⛔ 8.86% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
anibot/utils/data_parser.py get_anime 34 ⛔ 609 ⛔ 28 ⛔ 9.04% ⛔ 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!

@ghost
Copy link

ghost commented Sep 18, 2021

@sourcery-ai[bot]

@lostb053 lostb053 closed this Jan 11, 2022
@lostb053 lostb053 deleted the sourcery/pull-12 branch January 11, 2022 05:21
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.

None yet

2 participants