Skip to content

Conversation

@sourcery-ai
Copy link

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

Pull Request #286 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 add-signup-page branch, then run:

git fetch origin sourcery/add-signup-page
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from orronai September 11, 2021 20:24
@sourcery-ai sourcery-ai bot force-pushed the sourcery/add-signup-page branch from ced5adb to 1e0940d Compare September 11, 2021 20:54
Comment on lines -120 to -124
elif user.is_unverified:
login_message = _('עליך לאשר את המייל')
error_details = {'next': next_page, 'login_message': login_message}
return redirect(url_for('login', **error_details))

Copy link
Author

Choose a reason for hiding this comment

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

Function login refactored with the following changes:

@sourcery-ai sourcery-ai bot closed this Sep 11, 2021
@sourcery-ai sourcery-ai bot deleted the sourcery/add-signup-page branch September 11, 2021 20:54
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Sep 11, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.12 ⭐ 4.00 ⭐ -0.12 👍
Method Length 50.95 ⭐ 50.41 ⭐ -0.54 👍
Working memory 6.97 🙂 6.90 🙂 -0.07 👍
Quality 73.75% 🙂 74.26% 🙂 0.51% 👍
Other metrics Before After Change
Lines 506 504 -2
Changed files Quality Before Quality After Quality Change
lms/lmsweb/views.py 73.75% 🙂 74.26% 🙂 0.51% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
lms/lmsweb/views.py comment 13 🙂 202 😞 8 🙂 50.15% 🙂 Try splitting into smaller methods
lms/lmsweb/views.py login 7 ⭐ 144 😞 12 😞 53.04% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsweb/views.py view 7 ⭐ 134 😞 10 😞 57.80% 🙂 Try splitting into smaller methods. Extract out complex expressions
lms/lmsweb/views.py note 6 ⭐ 144 😞 8 🙂 61.90% 🙂 Try splitting into smaller methods
lms/lmsweb/views.py shared_solution 2 ⭐ 84 🙂 10 😞 69.27% 🙂 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.

1 participant