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 #12

Closed
wants to merge 2 commits into from
Closed

Beautified the code #12

wants to merge 2 commits into from

Conversation

notRyuk
Copy link

@notRyuk notRyuk commented Sep 18, 2021

No description provided.

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 18, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 23.98 😞 23.95 😞 -0.03 👍
Method Length 173.47 😞 168.47 😞 -5.00 👍
Working memory 15.82 ⛔ 15.59 ⛔ -0.23 👍
Quality 36.82% 😞 37.08% 😞 0.26% 👍
Other metrics Before After Change
Lines 3724 4070 346
Changed files Quality Before Quality After Quality Change
anibot/main.py 94.66% ⭐ 94.66% ⭐ 0.00%
anibot/plugins/anilist.py 40.13% 😞 40.48% 😞 0.35% 👍
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.25% 😞 0.34% 👍
anibot/plugins/jikan.py 76.67% ⭐ 76.67% ⭐ 0.00%
anibot/plugins/livechartme.py 10.94% ⛔ 10.94% ⛔ 0.00%
anibot/plugins/tracemoepy.py 29.47% 😞 29.47% 😞 0.00%
anibot/plugins/watch.py 56.43% 🙂 56.43% 🙂 0.00%
anibot/utils/data_parser.py 34.78% 😞 34.78% 😞 0.00%
anibot/utils/db.py 90.65% ⭐ 90.65% ⭐ 0.00%
anibot/utils/helper.py 48.63% 😞 49.41% 😞 0.78% 👍

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 86 ⛔ 1249 ⛔ 26 ⛔ 2.02% ⛔ 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 ⛔ 548 ⛔ 24 ⛔ 7.79% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
anibot/utils/data_parser.py get_anilist 35 ⛔ 622 ⛔ 30 ⛔ 8.29% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
anibot/utils/data_parser.py get_anime 35 ⛔ 617 ⛔ 29 ⛔ 8.45% ⛔ 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!

@lostb053
Copy link
Owner

In this line, you removed .drop() but how would i then update links again?
I mean try to imagine how that code works
It requires a way by which you remove all entries and i used collection.drop() for that

Also, this change was not needed i believe, not that i know python well, but have you deployed bot with this code?
If yes tell me, i wanna try something minor, will merge pr after that except for changes in anilist.py, as need to fix minor things

@F36
Copy link
Contributor

F36 commented Sep 19, 2021

Labum la ka shakalaka

@lostb053
Copy link
Owner

Labum la ka shakalaka

Shakalaka boom boom?

@notRyuk
Copy link
Author

notRyuk commented Sep 19, 2021

The first one u mentioned there the dropping the collection i mean that collection has only one element at the same time and for updating cache u dont need to drop the collection

And the second one changed for my own purpose for adding another wrapper but i dropped that idea in the last moment

@lostb053
Copy link
Owner

The first one u mentioned there the dropping the collection i mean that collection has only one element at the same time and for updating cache u dont need to drop the collection

And the second one changed for my own purpose for adding another wrapper but i dropped that idea in the last moment

Ic

@F36
Copy link
Contributor

F36 commented Sep 19, 2021

@lostb053 Wubba lubba dub dub

@lostb053
Copy link
Owner

@F36 When not that mf becomes that mf

@lostb053
Copy link
Owner

@F36 Lol

@F36
Copy link
Contributor

F36 commented Sep 19, 2021

@lostb053 (╯°□°)╯︵ ┻━┻

@lostb053 lostb053 closed this Jan 11, 2022
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

3 participants