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 Oct 18, 2022

Pull Request #148 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 next branch, then run:

git fetch origin sourcery/next
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 October 18, 2022 05:59
Comment on lines -334 to +338
if not has_expired:
return current_session
return await self._call_refresh_token(current_session.refresh_token)
return (
await self._call_refresh_token(current_session.refresh_token)
if has_expired
else current_session
)
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 AsyncGoTrueClient.get_session refactored with the following changes:

self._in_memory_session = session
expire_at = session.expires_at
if expire_at:
pass
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 AsyncGoTrueClient._save_session refactored with the following changes:

Comment on lines -651 to +652
session = Session.parse_obj(data)
return session
return Session.parse_obj(data)
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 AsyncGoTrueClient._get_valid_session refactored with the following changes:

if name in query_params:
return query_params[name][0]
return None
return query_params[name][0] if name in query_params else None
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 AsyncGoTrueClient._get_param refactored with the following changes:

Comment on lines -334 to +338
if not has_expired:
return current_session
return self._call_refresh_token(current_session.refresh_token)
return (
self._call_refresh_token(current_session.refresh_token)
if has_expired
else current_session
)
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 SyncGoTrueClient.get_session refactored with the following changes:

self._in_memory_session = session
expire_at = session.expires_at
if expire_at:
pass
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 SyncGoTrueClient._save_session refactored with the following changes:

Comment on lines -651 to +652
session = Session.parse_obj(data)
return session
return Session.parse_obj(data)
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 SyncGoTrueClient._get_valid_session refactored with the following changes:

if name in query_params:
return query_params[name][0]
return None
return query_params[name][0] if name in query_params else None
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 SyncGoTrueClient._get_param refactored with the following changes:

email=email,
password=password + "2",
)
await client.sign_in(email=email, password=f"{password}2")
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 test_sign_in_with_the_wrong_password refactored with the following changes:

email=email,
password=password + "2",
)
client.sign_in(email=email, password=f"{password}2")
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 test_sign_in_with_the_wrong_password refactored with the following changes:

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Oct 18, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.02%.

Quality metrics Before After Change
Complexity 1.35 ⭐ 1.35 ⭐ 0.00
Method Length 50.33 ⭐ 50.44 ⭐ 0.11 👎
Working memory 3.89 ⭐ 3.89 ⭐ 0.00
Quality 88.92% 88.90% -0.02% 👎
Other metrics Before After Change
Lines 208 202 -6
Changed files Quality Before Quality After Quality Change
tests/_async/test_client_with_auto_confirm_disabled.py 88.86% ⭐ 88.84% ⭐ -0.02% 👎
tests/_sync/test_client_with_auto_confirm_disabled.py 88.99% ⭐ 88.97% ⭐ -0.02% 👎

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 9e4a1f2 into next Oct 18, 2022
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