Remi-Gau / nilearn

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

temp (Sourcery refactored) #3

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

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

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

Help us improve this pull request!

ghost commented 1 year ago

Review on Crocodile

github-actions[bot] commented 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.

We will review it as quick as possible, feel free to ping us with questions if needed.

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 8.86 🙂 8.44 ⭐ -0.42 👍
Method Length 101.57 🙂 102.86 🙂 1.29 👎
Working memory 11.65 😞 11.81 😞 0.16 👎
Quality 52.53% 🙂 52.44% 🙂 -0.09% 👎
Other metrics Before After Change
Lines 335 329 -6
Changed files Quality Before Quality After Quality Change
nilearn/maskers/base_masker.py 52.53% 🙂 52.44% 🙂 -0.09% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
nilearn/maskers/base_masker.py _filter_and_extract 13 🙂 333 ⛔ 16 ⛔ 30.90% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/maskers/base_masker.py BaseMasker.fit_transform 4 ⭐ 121 😞 11 😞 60.38% 🙂 Try splitting into smaller methods. Extract out complex expressions
nilearn/maskers/base_masker.py BaseMasker.transform_single_imgs 0 ⭐ 26 ⭐ 10 😞 80.41% ⭐ 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 #3 (0cfba60) into formatting (0cb1d65) will decrease coverage by 0.01%. The diff coverage is 44.44%.

@@              Coverage Diff               @@
##           formatting       #3      +/-   ##
==============================================
- Coverage       90.96%   90.96%   -0.01%     
==============================================
  Files             133      133              
  Lines           15332    15330       -2     
  Branches         3022     3021       -1     
==============================================
- Hits            13947    13945       -2     
  Misses            819      819              
  Partials          566      566              
Impacted Files Coverage Δ
nilearn/maskers/base_masker.py 83.54% <44.44%> (-0.41%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.