arkrow / PyMusicLooper

A python program for repeating music endlessly and creating seamless music loops, with play/export/tagging support.
https://pypi.org/project/pymusiclooper/
MIT License
260 stars 24 forks source link

Sourcery refactored master branch #3

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

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[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 42.65 ⛔ 40.91 ⛔ -1.74 👍
Method Length 116.54 🙂 116.36 🙂 -0.18 👍
Working memory 12.58 😞 12.54 😞 -0.04 👍
Quality 37.29% 😞 37.66% 😞 0.37% 👍
Other metrics Before After Change
Lines 799 789 -10
Changed files Quality Before Quality After Quality Change
pymusiclooper/main.py 24.96% ⛔ 25.65% 😞 0.69% 👍
pymusiclooper/core.py 55.87% 🙂 55.93% 🙂 0.06% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
pymusiclooper/main.py cli_main 107 ⛔ 901 ⛔ 16 ⛔ 7.52% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pymusiclooper/main.py cli_main.batch_handler 30 😞 256 ⛔ 16 ⛔ 22.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pymusiclooper/core.py MusicLooper.find_loop_pairs 23 😞 457 ⛔ 12 😞 26.92% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pymusiclooper/main.py cli_main.interactive_handler 17 🙂 237 ⛔ 16 ⛔ 31.31% 😞 Try splitting into smaller methods. Extract out complex expressions
pymusiclooper/main.py cli_main.export_handler 11 🙂 145 😞 13 😞 47.64% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

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!

arkrow commented 2 years ago

Changes have been implemented based on this PR and will be merged in the 3.0 release