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

Change .update method to also allow dictionaries (Sourcery refactored) #130

Merged
merged 7 commits into from
Jul 13, 2022

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jul 12, 2022

Pull Request #129 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/supabase-community/gotrue-py pull/129/head
    git merge --ff-only FETCH_HEAD
    git push

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:

Help us improve this pull request!

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Jul 12, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.98 ⭐ 2.95 ⭐ -0.03 👍
Method Length 51.43 ⭐ 52.34 ⭐ 0.91 👎
Working memory 6.49 🙂 6.46 🙂 -0.03 👍
Quality 77.66% 77.67% 0.01% 👍
Other metrics Before After Change
Lines 2159 2226 67
Changed files Quality Before Quality After Quality Change
gotrue/types.py 79.94% ⭐ 79.45% ⭐ -0.49% 👎
gotrue/_async/client.py 73.93% 🙂 73.90% 🙂 -0.03% 👎
gotrue/_sync/client.py 74.21% 🙂 74.19% 🙂 -0.02% 👎
tests/_async/test_client_with_auto_confirm_enabled.py 79.90% ⭐ 79.91% ⭐ 0.01% 👍
tests/_sync/test_client_with_auto_confirm_enabled.py 80.17% ⭐ 80.18% ⭐ 0.01% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
gotrue/_async/client.py AsyncGoTrueClient.get_session_from_url 15 🙂 219 ⛔ 14 😞 36.39% 😞 Try splitting into smaller methods. Extract out complex expressions
gotrue/_sync/client.py SyncGoTrueClient.get_session_from_url 15 🙂 217 ⛔ 14 😞 36.53% 😞 Try splitting into smaller methods. Extract out complex expressions
gotrue/_async/client.py AsyncGoTrueClient.sign_in 11 🙂 111 🙂 11 😞 55.02% 🙂 Extract out complex expressions
gotrue/_sync/client.py SyncGoTrueClient.sign_in 11 🙂 104 🙂 11 😞 55.95% 🙂 Extract out complex expressions
gotrue/_async/client.py AsyncGoTrueClient.__init__ 3 ⭐ 88 🙂 16 ⛔ 58.70% 🙂 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
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #130 (0d6ed3c) into main (76fad56) will increase coverage by 0.22%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
+ Coverage   84.26%   84.48%   +0.22%     
==========================================
  Files          14       14              
  Lines        1042     1057      +15     
==========================================
+ Hits          878      893      +15     
  Misses        164      164              
Impacted Files Coverage Δ
gotrue/_async/client.py 89.49% <100.00%> (+0.13%) ⬆️
gotrue/_sync/client.py 89.49% <100.00%> (+0.13%) ⬆️
gotrue/types.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76fad56...0d6ed3c. Read the comment docs.

@leynier leynier merged commit df3f69e into main Jul 13, 2022
@leynier leynier deleted the sourcery/pull-129 branch August 21, 2022 19:18
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.

2 participants