Remi-Gau / nilearn

Machine learning for NeuroImaging in Python
http://nilearn.github.io
Other
1 stars 1 forks source link

[TEST] Format examples (Sourcery refactored) #13

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

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

git fetch origin sourcery/format_examples
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 28.14 😞 27.01 😞 -1.13 👍
Method Length 200.82 😞 200.55 😞 -0.27 👍
Working memory 19.23 ⛔ 18.72 ⛔ -0.51 👍
Quality 29.25% 😞 29.71% 😞 0.46% 👍
Other metrics Before After Change
Lines 830 822 -8
Changed files Quality Before Quality After Quality Change
nilearn/image/resampling.py 29.25% 😞 29.71% 😞 0.46% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
nilearn/image/resampling.py resample_img 54 ⛔ 901 ⛔ 26 ⛔ 4.16% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/image/resampling.py reorder_img 10 🙂 409 ⛔ 15 😞 33.36% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/image/resampling.py _resample_one_img 11 🙂 207 ⛔ 14 😞 40.66% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/image/resampling.py get_mask_bounds 2 ⭐ 180 😞 16 ⛔ 49.04% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/image/resampling.py coord_transform 2 ⭐ 146 😞 13 😞 56.15% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

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!

codecov-commenter commented 1 year ago

Codecov Report

Merging #13 (614ab43) into format_examples (7f45e46) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@                 Coverage Diff                 @@
##           format_examples      #13      +/-   ##
===================================================
- Coverage            91.00%   91.00%   -0.01%     
===================================================
  Files                  133      133              
  Lines                15350    15348       -2     
  Branches              3031     3031              
===================================================
- Hits                 13969    13967       -2     
  Misses                 817      817              
  Partials               564      564              
Impacted Files Coverage Δ
nilearn/image/resampling.py 93.88% <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.