Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Conversation

@sourcery-ai
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jan 15, 2022

Pull Request #68 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 fix/delete-user-returns-exception-event-if-response-is-ok branch, then run:

git fetch origin sourcery/fix/delete-user-returns-exception-event-if-response-is-ok
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from leynier January 15, 2022 07:54
self.headers = headers
self.cookie_options = cookie_options
self.http_client = http_client if http_client else AsyncClient()
self.http_client = http_client or AsyncClient()
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 AsyncGoTrueAPI.__init__ refactored with the following changes:

Comment on lines 241 to -244
data = {"phone": phone, "password": password}
url = f"{self.url}/token{query_string}"
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 AsyncGoTrueAPI.sign_in_with_phone refactored with the following changes:

Comment on lines 577 to -581
data = {"refresh_token": refresh_token}
url = f"{self.url}/token{query_string}"
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 AsyncGoTrueAPI.refresh_access_token refactored with the following changes:

self.headers = headers
self.cookie_options = cookie_options
self.http_client = http_client if http_client else SyncClient()
self.http_client = http_client or SyncClient()
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 SyncGoTrueAPI.__init__ refactored with the following changes:

Comment on lines 241 to -244
data = {"phone": phone, "password": password}
url = f"{self.url}/token{query_string}"
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 SyncGoTrueAPI.sign_in_with_phone refactored with the following changes:

Comment on lines 577 to -581
data = {"refresh_token": refresh_token}
url = f"{self.url}/token{query_string}"
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 SyncGoTrueAPI.refresh_access_token refactored with the following changes:

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Jan 15, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.78 ⭐ 0.79 ⭐ 0.01 👎
Method Length 40.40 ⭐ 39.98 ⭐ -0.42 👍
Working memory 6.58 🙂 6.50 🙂 -0.08 👍
Quality 83.24% 83.48% 0.24% 👍
Other metrics Before After Change
Lines 1232 1228 -4
Changed files Quality Before Quality After Quality Change
gotrue/_async/api.py 83.18% ⭐ 83.42% ⭐ 0.24% 👍
gotrue/_sync/api.py 83.31% ⭐ 83.55% ⭐ 0.24% 👍

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

File Function Complexity Length Working Memory Quality Recommendation

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!

@leynier leynier merged commit c8bff7b into fix/delete-user-returns-exception-event-if-response-is-ok Jan 15, 2022
leynier added a commit that referenced this pull request Jan 15, 2022
* fix: delete_user returns Exception event if response is Ok

* 'Refactored by Sourcery' (#69)

Co-authored-by: Sourcery AI <>

* chore: format code

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@leynier leynier deleted the sourcery/fix/delete-user-returns-exception-event-if-response-is-ok branch January 15, 2022 08:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants