postgrest-py
postgrest-py copied to clipboard
Implementation of `maybe_single` (Sourcery refactored)
Pull Request #118 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:
-
Merge this Pull Request instead of the original, or
-
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/postgrest-py pull/118/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!
Codecov Report
Merging #125 (2e6b7b5) into master (18334f8) will decrease coverage by
0.81%. The diff coverage is84.52%.
@@ Coverage Diff @@
## master #125 +/- ##
==========================================
- Coverage 92.78% 91.96% -0.82%
==========================================
Files 23 23
Lines 942 1095 +153
==========================================
+ Hits 874 1007 +133
- Misses 68 88 +20
| Impacted Files | Coverage Δ | |
|---|---|---|
| postgrest/_sync/client.py | 90.00% <ø> (ø) |
|
| postgrest/base_request_builder.py | 78.15% <71.42%> (-1.12%) |
:arrow_down: |
| postgrest/_async/request_builder.py | 84.52% <72.22%> (-11.40%) |
:arrow_down: |
| postgrest/_sync/request_builder.py | 84.52% <72.22%> (-11.40%) |
:arrow_down: |
| postgrest/__init__.py | 100.00% <100.00%> (ø) |
|
| tests/_async/test_client.py | 100.00% <100.00%> (ø) |
|
| tests/_async/test_request_builder.py | 100.00% <100.00%> (ø) |
|
| tests/_sync/test_client.py | 100.00% <100.00%> (ø) |
|
| tests/_sync/test_request_builder.py | 100.00% <100.00%> (ø) |
|
| ... and 3 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 f30e688...2e6b7b5. Read the comment docs.
Sourcery Code Quality Report
❌ Merging this PR will decrease code quality in the affected files by 1.64%.
| Quality metrics | Before | After | Change |
|---|---|---|---|
| Complexity | 0.38 ⭐ | 0.60 ⭐ | 0.22 👎 |
| Method Length | 25.16 ⭐ | 27.96 ⭐ | 2.80 👎 |
| Working memory | 5.14 ⭐ | 5.40 ⭐ | 0.26 👎 |
| Quality | 90.51% ⭐ | 88.87% ⭐ | -1.64% 👎 |
| Other metrics | Before | After | Change |
|---|---|---|---|
| Lines | 1459 | 1815 | 356 |
| Changed files | Quality Before | Quality After | Quality Change |
|---|---|---|---|
| postgrest/base_request_builder.py | 87.42% ⭐ | 87.17% ⭐ | -0.25% 👎 |
| postgrest/_async/request_builder.py | 84.14% ⭐ | 82.89% ⭐ | -1.25% 👎 |
| postgrest/_sync/client.py | 96.01% ⭐ | 96.01% ⭐ | 0.00% |
| postgrest/_sync/request_builder.py | 84.16% ⭐ | 82.94% ⭐ | -1.22% 👎 |
| tests/_async/test_client.py | 92.39% ⭐ | 87.17% ⭐ | -5.22% 👎 |
| tests/_async/test_request_builder.py | 94.09% ⭐ | 93.81% ⭐ | -0.28% 👎 |
| tests/_sync/test_client.py | 92.41% ⭐ | 87.24% ⭐ | -5.17% 👎 |
| tests/_sync/test_request_builder.py | 94.09% ⭐ | 93.81% ⭐ | -0.28% 👎 |
Here are some functions in these files that still need a tune-up:
| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
|---|---|---|---|---|---|---|
| tests/_async/test_request_builder.py | request_response_with_data | 0 ⭐ | 31 ⭐ | 10 😞 | 79.58% ⭐ | Extract out complex expressions |
| tests/_async/test_request_builder.py | request_response_with_single_data | 0 ⭐ | 31 ⭐ | 10 😞 | 79.58% ⭐ | Extract out complex expressions |
| tests/_sync/test_request_builder.py | request_response_with_data | 0 ⭐ | 31 ⭐ | 10 😞 | 79.58% ⭐ | Extract out complex expressions |
| tests/_sync/test_request_builder.py | request_response_with_single_data | 0 ⭐ | 31 ⭐ | 10 😞 | 79.58% ⭐ | 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!