drf-addons
drf-addons copied to clipboard
Refactor `else` / `elif` when `if` block has a `raise` statement
Refactor else
/ elif
when if
block has a raise
statement (#1)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Sourcery Code Quality Report
β Β Merging this PR will decrease code quality in the affected files by 0.66%.
Quality metrics | Before | After | Change |
---|---|---|---|
Complexity | 11.14 π | 11.64 π | 0.50 π |
Method Length | 51.62 β | 51.62 β | 0.00 |
Working memory | 8.18 π | 8.22 π | 0.04 π |
Quality | 63.06% π | 62.40% π | -0.66% π |
Other metrics | Before | After | Change |
---|---|---|---|
Lines | 399 | 399 | 0 |
Changed files | Quality Before | Quality After | Quality Change |
---|---|---|---|
drfaddons/auth.py | 70.96% π | 70.66% π | -0.30% π |
drfaddons/utils.py | 61.13% π | 60.34% π | -0.79% π |
Here are some functions in these files that still need a tune-up:
File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
---|---|---|---|---|---|---|
drfaddons/utils.py | send_message | 25 π | 257 β | 11 π | 31.86% π | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
drfaddons/utils.py | paginate_data | 10 π | 115 π | 12 π | 53.67% π | Extract out complex expressions |
drfaddons/utils.py | groupby_queryset_with_fields | 10 π | 79 π | 10 π | 62.29% π | 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!