Skip to content

Sourcery refactored master branch#1

Open
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master
Open

Sourcery refactored master branch#1
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Dec 11, 2021

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 StarkGang December 11, 2021 01:12
Comment on lines -38 to +43

total = len(self.objects)
pages_range = [*range(1, math.ceil(total/quant_per_page)+1)] # each item is a page
last_page = len(pages_range)


Copy link
Author

Choose a reason for hiding this comment

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

Function Pagination.create refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Dec 11, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 27.62 😞 26.51 😞 -1.11 👍
Method Length 126.00 😞 122.67 😞 -3.33 👍
Working memory 12.64 😞 12.62 😞 -0.02 👍
Quality 30.97% 😞 32.03% 😞 1.06% 👍
Other metrics Before After Change
Lines 82 89 7
Changed files Quality Before Quality After Quality Change
pyromod/nav/pagination.py 30.97% 😞 32.03% 😞 1.06% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
pyromod/nav/pagination.py Pagination.create 32 😞 308 ⛔ 13 😞 22.95% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pyromod/nav/pagination.py Pagination.__init__ 3 ⭐ 54 ⭐ 11 😞 70.96% 🙂 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