drf-user
drf-user copied to clipboard
WIP: Implement google authentication.
Hey, I just made a Pull Request!
Description
This PR implements google authentication.
Motivation and Context
Have you tested this? If so, how?
Checklist for PR author(s)
- [ ] Changes are covered by unit tests (no major decrease in code coverage %).
- [ ] All tests pass.
- [ ] Docstring coverage is 100% via
interrogate drf_user(I mean, we should set a good example :smile:). - [ ] Updates to documentation:
- [ ] Document any relevant additions/changes in
README.md. - [ ] Manually update both the
README.mdanddocs/index.rstfor any new changes. - [ ] Any changed/added classes/methods/functions have appropriate
versionadded,versionchanged, ordeprecateddirectives. Find the appropriate next version in the project's__init__.pyfile.
- [ ] Document any relevant additions/changes in
Release note
This pull request introduces 2 alerts when merging 68b42541a075eba4d51a279cdfc4adf29345e98b into 75d06fdafa7c5737ca6985c67416d71904315b3e - view on LGTM.com
new alerts:
- 2 for Module-level cyclic import
Sourcery Code Quality Report
❌ Merging this PR will decrease code quality in the affected files by 0.11%.
| Quality metrics | Before | After | Change |
|---|---|---|---|
| Complexity | 3.57 ⭐ | 3.54 ⭐ | -0.03 👍 |
| Method Length | 46.08 ⭐ | 47.09 ⭐ | 1.01 👎 |
| Working memory | 6.47 🙂 | 6.43 🙂 | -0.04 👍 |
| Quality | 78.99% ⭐ | 78.88% ⭐ | -0.11% 👎 |
| Other metrics | Before | After | Change |
|---|---|---|---|
| Lines | 1981 | 2068 | 87 |
| Changed files | Quality Before | Quality After | Quality Change |
|---|---|---|---|
| drf_user/init.py | 51.66% 🙂 | 51.66% 🙂 | 0.00% |
| drf_user/admin.py | 90.58% ⭐ | 90.58% ⭐ | 0.00% |
| drf_user/apps.py | 99.67% ⭐ | 99.67% ⭐ | 0.00% |
| drf_user/auth.py | 77.83% ⭐ | 77.83% ⭐ | 0.00% |
| drf_user/managers.py | 75.39% ⭐ | 74.10% 🙂 | -1.29% 👎 |
| drf_user/models.py | 97.11% ⭐ | 97.11% ⭐ | 0.00% |
| drf_user/serializers.py | 84.70% ⭐ | 85.06% ⭐ | 0.36% 👍 |
| drf_user/urls.py | 81.62% ⭐ | 80.38% ⭐ | -1.24% 👎 |
| drf_user/utils.py | 70.48% 🙂 | 71.70% 🙂 | 1.22% 👍 |
| drf_user/variables.py | 98.83% ⭐ | 96.18% ⭐ | -2.65% 👎 |
| drf_user/views.py | 61.72% 🙂 | 62.89% 🙂 | 1.17% 👍 |
| tests/test_views.py | 87.69% ⭐ | 87.69% ⭐ | 0.00% |
Here are some functions in these files that still need a tune-up:
| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
|---|---|---|---|---|---|---|
| drf_user/init.py | update_user_settings | 36 ⛔ | 126 😞 | 9 🙂 | 41.26% 😞 | Refactor to reduce nesting. Try splitting into smaller methods |
| drf_user/views.py | OTPLoginView.post | 15 🙂 | 245 ⛔ | 10 😞 | 41.48% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| drf_user/views.py | OTPView.post | 11 🙂 | 142 😞 | 13 😞 | 47.97% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| drf_user/utils.py | generate_otp | 4 ⭐ | 109 🙂 | 12 😞 | 60.18% 🙂 | Extract out complex expressions |
| drf_user/views.py | LoginView.post | 0 ⭐ | 93 🙂 | 13 😞 | 64.78% 🙂 | 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!
Codecov Report
Merging #113 (e9eeb9f) into master (75d06fd) will decrease coverage by
4.70%. The diff coverage is67.54%.
@@ Coverage Diff @@
## master #113 +/- ##
==========================================
- Coverage 95.68% 90.98% -4.71%
==========================================
Files 20 22 +2
Lines 649 721 +72
==========================================
+ Hits 621 656 +35
- Misses 28 65 +37
| Impacted Files | Coverage Δ | |
|---|---|---|
| drf_user/__init__.py | 77.41% <ø> (ø) |
|
| drf_user/admin.py | 90.00% <ø> (ø) |
|
| drf_user/apps.py | 100.00% <ø> (ø) |
|
| drf_user/models.py | 100.00% <ø> (ø) |
|
| drf_user/urls.py | 100.00% <ø> (ø) |
|
| drf_user/google_auth.py | 43.47% <43.47%> (ø) |
|
| drf_user/views.py | 88.72% <48.64%> (-9.14%) |
:arrow_down: |
| drf_user/utils.py | 92.85% <75.00%> (-3.78%) |
:arrow_down: |
| drf_user/managers.py | 96.55% <80.00%> (-3.45%) |
:arrow_down: |
| drf_user/auth.py | 74.07% <100.00%> (+3.24%) |
:arrow_up: |
| ... and 5 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 75d06fd...e9eeb9f. Read the comment docs.