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 master branch #1

Merged
merged 1 commit into from
Mar 13, 2022
Merged

Sourcery refactored master branch #1

merged 1 commit into from
Mar 13, 2022

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Mar 13, 2022

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 monty-dev March 13, 2022 10:49
Comment on lines -177 to +181
warnings.warn(("The %s method is deprecated and will be removed in v2.*.*" % name), DeprecationWarning)
warnings.warn(
f"The {name} method is deprecated and will be removed in v2.*.*",
DeprecationWarning,
)

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 _deprecated.with_warning refactored with the following changes:

Comment on lines -242 to +257
if not (values and all(_is_uint(x) for x in values)):
return ""

return _encode(values, self._salt, self._min_length, self._alphabet, self._separators, self._guards)
return (
_encode(
values,
self._salt,
self._min_length,
self._alphabet,
self._separators,
self._guards,
)
if (values and all(_is_uint(x) for x in values))
else ""
)
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 Hashids.encode refactored with the following changes:

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Mar 13, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.88 ⭐ 2.89 ⭐ 0.01 👎
Method Length 52.39 ⭐ 52.50 ⭐ 0.11 👎
Working memory 7.40 🙂 7.52 🙂 0.12 👎
Quality 75.08% 74.66% 🙂 -0.42% 👎
Other metrics Before After Change
Lines 232 248 16
Changed files Quality Before Quality After Quality Change
src/tuuid/_hashids.py 75.08% ⭐ 74.66% 🙂 -0.42% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
src/tuuid/_hashids.py _encode 2 ⭐ 116 🙂 14 😞 58.28% 🙂 Extract out complex expressions
src/tuuid/_hashids.py Hashids.__init__ 5 ⭐ 188 😞 8 🙂 58.66% 🙂 Try splitting into smaller methods
src/tuuid/_hashids.py _decode 3 ⭐ 80 🙂 10 😞 68.86% 🙂 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!

@monty-dev monty-dev merged commit bcb99b6 into master Mar 13, 2022
@monty-dev monty-dev deleted the sourcery/master branch March 13, 2022 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant