Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] add basic QC (Sourcery refactored) #104

Merged
merged 20 commits into from
Dec 17, 2022
Merged

[ENH] add basic QC (Sourcery refactored) #104

merged 20 commits into from
Dec 17, 2022

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Dec 17, 2022

Pull Request #102 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/cpp-lln-lab/bidsMReye pull/102/head
    git merge --ff-only FETCH_HEAD
    git push

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:

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Remi-Gau December 17, 2022 13:14
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Dec 17, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.50 ⭐ 2.47 ⭐ -1.03 👍
Method Length 74.60 🙂 77.32 🙂 2.72 👎
Working memory 7.02 🙂 6.92 🙂 -0.10 👍
Quality 71.61% 🙂 72.84% 🙂 1.23% 👍
Other metrics Before After Change
Lines 1029 1754 725
Changed files Quality Before Quality After Quality Change
bidsmreye/generalize.py 64.54% 🙂 66.72% 🙂 2.18% 👍
bidsmreye/prepare_data.py 64.46% 🙂 68.35% 🙂 3.89% 👍
bidsmreye/quality_control.py 61.40% 🙂
bidsmreye/utils.py 75.13% ⭐ 76.08% ⭐ 0.95% 👍
bidsmreye/visualize.py 64.15% 🙂
tests/test_generalize.py 90.60% ⭐ 85.83% ⭐ -4.77% 👎
tests/test_quality_control.py 90.20% ⭐
tests/test_visualize.py 93.69% ⭐
tests/utils.py 84.76% ⭐

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

File Function Complexity Length Working Memory Quality Recommendation
bidsmreye/quality_control.py compute_robust_outliers 6 ⭐ 300 ⛔ 14 😞 40.66% 😞 Try splitting into smaller methods. Extract out complex expressions
bidsmreye/visualize.py plot_time_series 4 ⭐ 274 ⛔ 13 😞 44.99% 😞 Try splitting into smaller methods. Extract out complex expressions
bidsmreye/generalize.py process_subject 4 ⭐ 216 ⛔ 12 😞 49.66% 😞 Try splitting into smaller methods. Extract out complex expressions
bidsmreye/utils.py Config.check_argument 11 🙂 177 😞 9 🙂 51.74% 🙂 Try splitting into smaller methods
bidsmreye/utils.py Config.__attrs_post_init__ 9 🙂 214 ⛔ 7 🙂 55.23% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Attention: Patch coverage is 88.08511% with 28 lines in your changes missing coverage. Please review.

Project coverage is 75.00%. Comparing base (001c90c) to head (7ce73b3).
Report is 169 commits behind head on main.

Files with missing lines Patch % Lines
bidsmreye/utils.py 57.14% 8 Missing and 1 partial ⚠️
bidsmreye/prepare_data.py 42.85% 8 Missing ⚠️
bidsmreye/quality_control.py 94.21% 3 Missing and 4 partials ⚠️
bidsmreye/generalize.py 75.00% 3 Missing ⚠️
bidsmreye/visualize.py 98.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
+ Coverage   65.45%   75.00%   +9.54%     
==========================================
  Files           7        9       +2     
  Lines         576      776     +200     
  Branches       88      104      +16     
==========================================
+ Hits          377      582     +205     
+ Misses        167      151      -16     
- Partials       32       43      +11     
Flag Coverage Δ
tests 74.87% <87.65%> (+9.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-102 branch from da5f985 to 1175546 Compare December 17, 2022 13:24
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-102 branch from 1175546 to 7ce73b3 Compare December 17, 2022 13:37
@sourcery-ai sourcery-ai bot closed this Dec 17, 2022
@sourcery-ai sourcery-ai bot deleted the sourcery/pull-102 branch December 17, 2022 13:37
@Remi-Gau Remi-Gau restored the sourcery/pull-102 branch December 17, 2022 13:38
@Remi-Gau Remi-Gau reopened this Dec 17, 2022
@Remi-Gau Remi-Gau merged commit 3e5935d into main Dec 17, 2022
@Remi-Gau Remi-Gau deleted the sourcery/pull-102 branch December 17, 2022 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant