Remi-Gau / nilearn

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

test flake8 in ci (Sourcery refactored) #15

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

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

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

Help us improve this pull request!

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.95%.

Quality metrics Before After Change
Complexity 14.86 🙂 13.82 🙂 -1.04 👍
Method Length 157.83 😞 157.50 😞 -0.33 👍
Working memory 15.80 ⛔ 15.80 ⛔ 0.00
Quality 41.38% 😞 42.33% 😞 0.95% 👍
Other metrics Before After Change
Lines 927 919 -8
Changed files Quality Before Quality After Quality Change
nilearn/decoding/decoder.py 41.38% 😞 42.33% 😞 0.95% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
nilearn/decoding/decoder.py _BaseDecoder.fit 24 😞 589 ⛔ 16 ⛔ 20.38% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/decoder.py _parallel_fit 28 😞 295 ⛔ 17 ⛔ 20.53% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/decoder.py _BaseDecoder._fetch_parallel_fit_outputs 17 🙂 300 ⛔ 18 ⛔ 26.69% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/decoder.py _BaseDecoder.__init__ 0 ⭐ 167 😞 30 ⛔ 45.69% 😞 Try splitting into smaller methods. Extract out complex expressions
nilearn/decoding/decoder.py FREMRegressor.__init__ 1 ⭐ 149 😞 30 ⛔ 46.50% 😞 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!