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

Sourcery refactored main branch #2

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Sourcery refactored main branch #2

merged 1 commit into from
Apr 14, 2022

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Apr 14, 2022

Branch main 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 main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from JeffResc April 14, 2022 15:48
return re.search(regex, read(*path)).group("version")
return re.search(regex, read(*path))["version"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_version refactored with the following changes:

install_requires=list(val.strip() for val in open("requirements.txt")),
install_requires=[val.strip() for val in open("requirements.txt")],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 42-42 refactored with the following changes:

Comment on lines -104 to +109
results = await self._request(f"v2/workers/worker/pause", method='POST', data=json.dumps({"worker_id": worker_id}))
results = await self._request(
"v2/workers/worker/pause",
method='POST',
data=json.dumps({"worker_id": worker_id}),
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Unmanic.pause_worker refactored with the following changes:

Comment on lines -138 to +148
results = await self._request(f"v2/workers/worker/resume", method='POST', data=json.dumps({"worker_id": worker_id}))
results = await self._request(
"v2/workers/worker/resume",
method='POST',
data=json.dumps({"worker_id": worker_id}),
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Unmanic.resume_worker refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Apr 14, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.41 ⭐ 1.41 ⭐ 0.00
Method Length 32.70 ⭐ 32.48 ⭐ -0.22 👍
Working memory 5.80 ⭐ 5.80 ⭐ 0.00
Quality 87.61% 87.64% 0.03% 👍
Other metrics Before After Change
Lines 310 320 10
Changed files Quality Before Quality After Quality Change
setup.py 83.93% ⭐ 84.07% ⭐ 0.14% 👍
unmanic_api/unmanic.py 88.10% ⭐ 88.12% ⭐ 0.02% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
unmanic_api/unmanic.py Unmanic.__init__ 0 ⭐ 42 ⭐ 16 ⛔ 68.78% 🙂 Extract out complex expressions
unmanic_api/unmanic.py Unmanic.get_pending_tasks 1 ⭐ 51 ⭐ 11 😞 73.43% 🙂 Extract out complex expressions
unmanic_api/unmanic.py Unmanic.get_task_history 1 ⭐ 51 ⭐ 11 😞 73.43% 🙂 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!

@codecov-commenter
Copy link

Codecov Report

Merging #2 (4ea40cb) into main (811bfe9) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main       #2   +/-   ##
=======================================
  Coverage   98.93%   98.93%           
=======================================
  Files           6        6           
  Lines         281      281           
=======================================
  Hits          278      278           
  Misses          3        3           
Flag Coverage Δ
unittests 98.93% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
unmanic_api/unmanic.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 811bfe9...4ea40cb. Read the comment docs.

@JeffResc JeffResc merged commit 091814b into main Apr 14, 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

2 participants