Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Sourcery refactored master branch#11

Open
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master
Open

Sourcery refactored master branch#11
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot commented Nov 5, 2021

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 sourcery-ai bot requested a review from unique1o1 November 5, 2021 14:21
Comment on lines -93 to +99
def get_songs()->Iterator:
def get_songs() -> Iterator:
"""
Return songs that have the fingerprinted flag set TRUE (1).
"""
with session_withcommit() as session:
val = session.query(songs).all()
for row in val:
yield row
yield from val
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 get_songs refactored with the following changes:

  • Replace yield inside for loop with yield from (yield-from)

for chn in range(audiofile.channels):
channels.append(data[chn::audiofile.channels])

channels = [data[chn::audiofile.channels] for chn in range(audiofile.channels)]
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 read refactored with the following changes:

@sourcery-ai
Copy link
Copy Markdown
Author

sourcery-ai bot commented Nov 5, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.70 ⭐ 0.55 ⭐ -0.15 👍
Method Length 36.00 ⭐ 35.63 ⭐ -0.37 👍
Working memory 5.84 ⭐ 5.87 ⭐ 0.03 👎
Quality 84.46% 84.55% 0.09% 👍
Other metrics Before After Change
Lines 174 170 -4
Changed files Quality Before Quality After Quality Change
Metamusic/database.py 83.73% ⭐ 83.68% ⭐ -0.05% 👎
Metamusic/decoder.py 88.04% ⭐ 89.28% ⭐ 1.24% 👍

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

File Function Complexity Length Working Memory Quality Recommendation

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants