Skip to content

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Feb 22, 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 ChecksumDev February 22, 2022 15:09
async with aioopen(
path.join("data", "uploads", user["safe_username"],
file_id + ".hg"), "wb") as f:
async with aioopen(path.join("data", "uploads", user["safe_username"], f'{file_id}.hg'), "wb") as f:
Copy link
Author

Choose a reason for hiding this comment

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

Function post_file refactored with the following changes:

Comment on lines -184 to +182
async with aioopen(
path.join("data", "uploads", user["safe_username"],
file_id + ".hg"), "rb") as file:
async with aioopen(path.join("data", "uploads", user["safe_username"], f'{file_id}.hg'), "rb") as file:
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_file refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 22, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.98 ⭐ 6.98 ⭐ 0.00
Method Length 199.00 😞 199.67 😞 0.67 👎
Working memory 15.77 ⛔ 15.77 ⛔ 0.00
Quality 39.01% 😞 38.97% 😞 -0.04% 👎
Other metrics Before After Change
Lines 211 207 -4
Changed files Quality Before Quality After Quality Change
src/routes/v1/sharex.py 39.01% 😞 38.97% 😞 -0.04% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
src/routes/v1/sharex.py get_file 10 🙂 303 ⛔ 15 😞 35.53% 😞 Try splitting into smaller methods. Extract out complex expressions
src/routes/v1/sharex.py post_file 4 ⭐ 262 ⛔ 17 ⛔ 40.73% 😞 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.

0 participants