Remi-Gau / nilearn

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

temp (Sourcery refactored) #5

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #4 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 increase code quality in the affected files by 0.45%.

Quality metrics Before After Change
Complexity 14.95 πŸ™‚ 14.27 πŸ™‚ -0.68 πŸ‘
Method Length 145.04 😞 144.66 😞 -0.38 πŸ‘
Working memory 14.13 😞 14.09 😞 -0.04 πŸ‘
Quality 47.72% 😞 48.17% 😞 0.45% πŸ‘
Other metrics Before After Change
Lines 7466 7419 -47
Changed files Quality Before Quality After Quality Change
nilearn/decoding/decoder.py 41.38% 😞 42.33% 😞 0.95% πŸ‘
nilearn/decoding/fista.py 14.04% β›” 14.61% β›” 0.57% πŸ‘
nilearn/decoding/objective_functions.py 77.37% ⭐ 77.43% ⭐ 0.06% πŸ‘
nilearn/decoding/proximal_operators.py 29.18% 😞 30.36% 😞 1.18% πŸ‘
nilearn/decoding/searchlight.py 60.42% πŸ™‚ 62.10% πŸ™‚ 1.68% πŸ‘
nilearn/decoding/space_net.py 35.48% 😞 36.57% 😞 1.09% πŸ‘
nilearn/decoding/space_net_solvers.py 60.45% πŸ™‚ 61.11% πŸ™‚ 0.66% πŸ‘
nilearn/decoding/tests/simulate_graph_net_data.py 41.96% 😞 42.00% 😞 0.04% πŸ‘
nilearn/decoding/tests/test_decoder.py 57.24% πŸ™‚ 57.28% πŸ™‚ 0.04% πŸ‘
nilearn/decoding/tests/test_same_api.py 65.32% πŸ™‚ 65.46% πŸ™‚ 0.14% πŸ‘
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% πŸ‘

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/decoding/proximal_operators.py _prox_tvl1 45 β›” 473 β›” 28 β›” 6.04% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/space_net.py path_scores 36 β›” 549 β›” 37 β›” 7.48% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/fista.py mfista 38 β›” 423 β›” 29 β›” 8.27% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/space_net.py BaseSpaceNet.fit 35 β›” 834 β›” 28 β›” 8.49% β›” Refactor to reduce nesting. 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 #5 (5d62018) into formatting (2ee9bc1) will increase coverage by 0.05%. The diff coverage is 83.05%.

@@              Coverage Diff               @@
##           formatting       #5      +/-   ##
==============================================
+ Coverage       91.00%   91.05%   +0.05%     
==============================================
  Files             133      133              
  Lines           15356    15322      -34     
  Branches         3033     3015      -18     
==============================================
- Hits            13975    13952      -23     
+ Misses            817      813       -4     
+ Partials          564      557       -7     
Impacted Files Coverage Ξ”
nilearn/decoding/fista.py 87.65% <20.00%> (ΓΈ)
nilearn/decoding/objective_functions.py 88.60% <66.66%> (+2.02%) :arrow_up:
nilearn/decoding/proximal_operators.py 71.96% <66.66%> (+0.14%) :arrow_up:
nilearn/decoding/space_net.py 88.23% <82.35%> (+0.01%) :arrow_up:
nilearn/glm/second_level/second_level.py 97.52% <95.00%> (+0.29%) :arrow_up:
nilearn/decoding/decoder.py 96.65% <100.00%> (+0.68%) :arrow_up:
nilearn/decoding/searchlight.py 96.00% <100.00%> (+2.25%) :arrow_up:
nilearn/decoding/space_net_solvers.py 98.02% <100.00%> (-0.04%) :arrow_down:
nilearn/mass_univariate/permuted_least_squares.py 91.28% <100.00%> (+0.82%) :arrow_up:

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