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

Speed up adding tracks from playlist #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nznaza
Copy link

@nznaza nznaza commented Jan 3, 2023

Changed Playlist addTrack embed messages, to send them in one batch, speeding up adding tracks from a playlist.
Changed youtube playlist lookup function to avoid searching a known playlist url

…peeding up adding tracks from a playlist, changed youtube playlist looup function to avoid searching a known playlist url
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 3, 2023

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.82%.

Quality metrics Before After Change
Complexity 14.41 🙂 15.16 🙂 0.75 👎
Method Length 137.36 😞 138.54 😞 1.18 👎
Working memory 11.87 😞 11.80 😞 -0.07 👍
Quality 43.86% 😞 43.04% 😞 -0.82% 👎
Other metrics Before After Change
Lines 517 532 15
Changed files Quality Before Quality After Quality Change
Cogs/events.py 42.31% 😞 42.31% 😞 0.00%
Cogs/play.py 54.94% 🙂 55.15% 🙂 0.21% 👍
Cogs/skip.py 48.43% 😞 48.43% 😞 0.00%
Tools/addTrack.py 8.87% ⛔ 9.78% ⛔ 0.91% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
Tools/addTrack.py addTrack 38 ⛔ 726 ⛔ 21 ⛔ 9.78% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cogs/events.py EventsCog.on_command_error 16 🙂 489 ⛔ 15 😞 27.53% 😞 Try splitting into smaller methods. Extract out complex expressions
Cogs/events.py EventsCog.on_voice_state_update 20 😞 245 ⛔ 14 😞 31.02% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cogs/play.py CogPlay.play 24 😞 277 ⛔ 10 😞 33.49% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Cogs/skip.py CogSkip.skip 8 ⭐ 300 ⛔ 14 😞 38.75% 😞 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.

1 participant