Closed sourcery-ai[bot] closed 1 year ago
👋 @sourcery-ai[bot] Thanks for creating a PR!
Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.
Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
Closes #XXXX
(see our documentation on PR structure)doc/changes/latest.rst
(see our documentation on PR structure)For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed.
✅ Merging this PR will increase code quality in the affected files by 0.24%.
Quality metrics | Before | After | Change |
---|---|---|---|
Complexity | 16.28 🙂 | 15.94 🙂 | -0.34 👍 |
Method Length | 167.63 😞 | 167.46 😞 | -0.17 👍 |
Working memory | 13.39 😞 | 13.37 😞 | -0.02 👍 |
Quality | 47.76% 😞 | 48.00% 😞 | 0.24% 👍 |
Other metrics | Before | After | Change |
---|---|---|---|
Lines | 3631 | 3624 | -7 |
Changed files | Quality Before | Quality After | Quality Change |
---|---|---|---|
examples/04_glm_first_level/plot_bids_features.py | 48.54% 😞 | 48.53% 😞 | -0.01% 👎 |
examples/04_glm_first_level/plot_predictions_residuals.py | 38.08% 😞 | 38.09% 😞 | 0.01% 👍 |
nilearn/glm/second_level/second_level.py | 49.07% 😞 | 49.56% 😞 | 0.49% 👍 |
nilearn/glm/tests/test_second_level.py | 60.96% 🙂 | 60.94% 🙂 | -0.02% 👎 |
nilearn/glm/tests/test_utils.py | 71.24% 🙂 | 71.77% 🙂 | 0.53% 👍 |
nilearn/mass_univariate/permuted_least_squares.py | 3.57% ⛔ | 3.61% ⛔ | 0.04% 👍 |
nilearn/reporting/_get_clusters_table.py | 44.98% 😞 | 45.85% 😞 | 0.87% 👍 |
Here are some functions in these files that still need a tune-up:
File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
---|---|---|---|---|---|---|
nilearn/mass_univariate/permuted_least_squares.py | permuted_ols | 84 ⛔ | 1371 ⛔ | 30 ⛔ | 1.30% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
nilearn/mass_univariate/permuted_least_squares.py | _permuted_ols_on_chunk | 30 😞 | 472 ⛔ | 27 ⛔ | 11.51% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
nilearn/glm/second_level/second_level.py | _check_second_level_input | 52 ⛔ | 245 ⛔ | 14 😞 | 18.41% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
nilearn/reporting/_get_clusters_table.py | get_clusters_table | 21 😞 | 438 ⛔ | 20 ⛔ | 19.76% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
nilearn/glm/second_level/second_level.py | non_parametric_inference | 14 🙂 | 449 ⛔ | 23 ⛔ | 23.53% ⛔ | Try splitting into smaller methods. Extract out complex expressions |
The emojis denote the absolute quality of the code:
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!
Merging #9 (d383e0d) into checklist (52ec59b) will increase coverage by
0.01%
. The diff coverage is95.45%
.
@@ Coverage Diff @@
## checklist #9 +/- ##
=============================================
+ Coverage 91.01% 91.02% +0.01%
=============================================
Files 133 133
Lines 15362 15352 -10
Branches 3035 3028 -7
=============================================
- Hits 13981 13974 -7
+ Misses 817 816 -1
+ Partials 564 562 -2
Impacted Files | Coverage Δ | |
---|---|---|
nilearn/glm/second_level/second_level.py | 97.52% <95.00%> (+0.29%) |
:arrow_up: |
nilearn/mass_univariate/permuted_least_squares.py | 91.28% <100.00%> (+0.82%) |
:arrow_up: |
nilearn/reporting/_get_clusters_table.py | 97.14% <100.00%> (-0.06%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Pull Request #8 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
checklist
branch, then run:Help us improve this pull request!