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

Wip check fors3 (Sourcery refactored) #270

Closed
wants to merge 1 commit into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Sep 8, 2022

Pull Request #269 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

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 wip-check-fors3 branch, then run:

git fetch origin sourcery/wip-check-fors3
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Sourcery AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Sep 8, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.66 ⭐ 4.66 ⭐ 0.00
Method Length 84.14 🙂 84.07 🙂 -0.07 👍
Working memory 6.69 🙂 6.69 🙂 0.00
Quality 69.12% 🙂 69.13% 🙂 0.01% 👍
Other metrics Before After Change
Lines 328 329 1
Changed files Quality Before Quality After Quality Change
nuxeo/handlers/s3.py 69.12% 🙂 69.13% 🙂 0.01% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
nuxeo/handlers/s3.py ChunkUploaderS3._state 10 🙂 177 😞 9 🙂 52.64% 🙂 Try splitting into smaller methods
nuxeo/handlers/s3.py ChunkUploaderS3.iter_upload 7 ⭐ 223 ⛔ 7 🙂 56.53% 🙂 Try splitting into smaller methods

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
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #270 (ef6b15b) into wip-check-fors3 (cf7948e) will not change coverage.
The diff coverage is 100.00%.

@@               Coverage Diff                @@
##           wip-check-fors3     #270   +/-   ##
================================================
  Coverage            96.29%   96.29%           
================================================
  Files                   29       29           
  Lines                 1808     1808           
================================================
  Hits                  1741     1741           
  Misses                  67       67           
Flag Coverage Δ
unit 96.29% <100.00%> (ø)

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

Impacted Files Coverage Δ
nuxeo/handlers/s3.py 89.58% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-check-fors3 branch 9 times, most recently from 1ab38dc to 23369a7 Compare September 14, 2022 11:39

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found the following improvement in Function ChunkUploaderS3._state:

Comment on lines -271 to +274
to_upload = set(range(1, self.chunk_count + 1, 1)) - set(
to_upload = set(range(1, self.chunk_count + 1)) - set(
self.blob.uploadedChunkIds
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function ChunkUploaderS3._compute_chunks_left refactored with the following changes:

@sourcery-ai sourcery-ai bot closed this Oct 11, 2022
@sourcery-ai sourcery-ai bot deleted the sourcery/wip-check-fors3 branch October 11, 2022 05:59
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

1 participant