Remi-Gau / nilearn

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

temp #4

Closed Remi-Gau closed 1 year ago

github-actions[bot] commented 1 year ago

πŸ‘‹ @Remi-Gau 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.

ghost commented 1 year ago

Review on Crocodile

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 10.37 πŸ™‚ 11.16 πŸ™‚ 0.79 πŸ‘Ž
Method Length 131.81 😞 133.71 😞 1.90 πŸ‘Ž
Working memory 12.92 😞 12.85 😞 -0.07 πŸ‘
Quality 52.35% πŸ™‚ 51.95% πŸ™‚ -0.40% πŸ‘Ž
Other metrics Before After Change
Lines 9112 10306 1194
Changed files Quality Before Quality After Quality Change
nilearn/decoding/__init__.py 86.05% ⭐ 86.05% ⭐ 0.00%
nilearn/decoding/decoder.py 41.44% 😞 41.38% 😞 -0.06% πŸ‘Ž
nilearn/decoding/fista.py 14.28% β›” 14.04% β›” -0.24% πŸ‘Ž
nilearn/decoding/objective_functions.py 77.42% ⭐ 77.37% ⭐ -0.05% πŸ‘Ž
nilearn/decoding/proximal_operators.py 29.17% 😞 29.18% 😞 0.01% πŸ‘
nilearn/decoding/searchlight.py 60.86% πŸ™‚ 60.42% πŸ™‚ -0.44% πŸ‘Ž
nilearn/decoding/space_net.py 35.72% 😞 35.48% 😞 -0.24% πŸ‘Ž
nilearn/decoding/space_net_solvers.py 60.64% πŸ™‚ 60.45% πŸ™‚ -0.19% πŸ‘Ž
nilearn/decoding/tests/simulate_graph_net_data.py 41.96% 😞 41.96% 😞 0.00%
nilearn/decoding/tests/test_decoder.py 57.24% πŸ™‚ 57.24% πŸ™‚ 0.00%
nilearn/decoding/tests/test_fista.py 55.39% πŸ™‚ 54.05% πŸ™‚ -1.34% πŸ‘Ž
nilearn/decoding/tests/test_graph_net.py 70.27% πŸ™‚ 71.38% πŸ™‚ 1.11% πŸ‘
nilearn/decoding/tests/test_objective_functions.py 80.36% ⭐ 80.36% ⭐ 0.00%
nilearn/decoding/tests/test_operators.py 65.39% πŸ™‚ 65.39% πŸ™‚ 0.00%
nilearn/decoding/tests/test_same_api.py 65.32% πŸ™‚ 65.32% πŸ™‚ 0.00%
nilearn/decoding/tests/test_searchlight.py 40.96% 😞 40.96% 😞 0.00%
nilearn/decoding/tests/test_sklearn_compatibility.py 64.04% πŸ™‚ 63.74% πŸ™‚ -0.30% πŸ‘Ž
nilearn/decoding/tests/test_space_net.py 72.59% πŸ™‚ 72.49% πŸ™‚ -0.10% πŸ‘Ž
nilearn/decoding/tests/test_tv.py 72.72% πŸ™‚ 72.72% πŸ™‚ 0.00%
nilearn/decomposition/_base.py 57.66% πŸ™‚ 57.63% πŸ™‚ -0.03% πŸ‘Ž
nilearn/decomposition/_multi_pca.py 64.67% πŸ™‚ 64.67% πŸ™‚ 0.00%
nilearn/decomposition/canica.py 51.20% πŸ™‚ 51.20% πŸ™‚ 0.00%
nilearn/decomposition/dict_learning.py 62.73% πŸ™‚ 62.73% πŸ™‚ 0.00%
nilearn/glm/second_level/second_level.py 49.67% 😞 49.07% 😞 -0.60% πŸ‘Ž
nilearn/glm/tests/test_second_level.py 61.73% πŸ™‚ 60.96% πŸ™‚ -0.77% πŸ‘Ž
nilearn/glm/tests/test_utils.py 71.32% πŸ™‚ 71.24% πŸ™‚ -0.08% πŸ‘Ž
nilearn/mass_univariate/permuted_least_squares.py 4.23% β›” 3.57% β›” -0.66% πŸ‘Ž
nilearn/mass_univariate/tests/test_permuted_least_squares.py 55.69% πŸ™‚ 54.14% πŸ™‚ -1.55% πŸ‘Ž

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 48 β›” 486 β›” 28 β›” 5.31% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/space_net.py BaseSpaceNet.fit 41 β›” 841 β›” 28 β›” 6.46% β›” 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 40 β›” 422 β›” 29 β›” 7.64% β›” 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 #4 (2ee9bc1) into main (3e4652f) will increase coverage by 23.59%. The diff coverage is 89.71%.

@@             Coverage Diff             @@
##             main       #4       +/-   ##
===========================================
+ Coverage   67.40%   91.00%   +23.59%     
===========================================
  Files         133      133               
  Lines       15286    15356       +70     
  Branches     2937     3033       +96     
===========================================
+ Hits        10304    13975     +3671     
+ Misses       4546      817     -3729     
- Partials      436      564      +128     
Impacted Files Coverage Ξ”
nilearn/decomposition/_base.py 94.87% <ΓΈ> (ΓΈ)
nilearn/decomposition/_multi_pca.py 100.00% <ΓΈ> (ΓΈ)
nilearn/decomposition/canica.py 91.66% <ΓΈ> (ΓΈ)
nilearn/decomposition/dict_learning.py 89.06% <ΓΈ> (ΓΈ)
nilearn/decoding/proximal_operators.py 71.81% <73.07%> (ΓΈ)
nilearn/decoding/space_net.py 88.21% <81.25%> (ΓΈ)
nilearn/decoding/fista.py 87.65% <85.71%> (ΓΈ)
nilearn/decoding/objective_functions.py 86.58% <86.66%> (-0.17%) :arrow_down:
nilearn/decoding/decoder.py 95.97% <97.77%> (ΓΈ)
nilearn/decoding/__init__.py 100.00% <100.00%> (ΓΈ)
... and 57 more

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