Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Sourcery refactored main branch #64

Merged
merged 3 commits into from May 26, 2022
Merged

Sourcery refactored main branch #64

merged 3 commits into from May 26, 2022

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented May 26, 2022

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

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 main branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from wdika May 26, 2022 13:12
mridc/core/classes/export.py Outdated Show resolved Hide resolved
mridc/core/classes/modelPT.py Outdated Show resolved Hide resolved
mridc/core/neural_types/elements.py Outdated Show resolved Hide resolved
mridc/utils/exp_manager.py Outdated Show resolved Hide resolved
mridc/utils/metaclasses.py Outdated Show resolved Hide resolved
Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Worth considering though. View full project report here.

mridc/utils/metaclasses.py Outdated Show resolved Hide resolved
@wdika wdika self-assigned this May 26, 2022
@wdika wdika added the enhancement New feature or request label May 26, 2022
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #64 (6e1dd83) into main (e2c50f3) will increase coverage by 0.02%.
The diff coverage is 8.33%.

@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
+ Coverage   56.34%   56.36%   +0.02%     
==========================================
  Files         170      170              
  Lines       10062    10057       -5     
==========================================
  Hits         5669     5669              
+ Misses       4393     4388       -5     
Impacted Files Coverage Δ
mridc/collections/reconstruction/models/dunet.py 85.45% <ø> (ø)
mridc/collections/reconstruction/models/kikinet.py 91.66% <ø> (ø)
mridc/collections/reconstruction/models/lpd.py 91.04% <ø> (ø)
mridc/collections/reconstruction/models/vsnet.py 88.00% <ø> (ø)
mridc/core/classes/common.py 32.93% <ø> (ø)
mridc/core/classes/modelPT.py 24.78% <0.00%> (+0.26%) ⬆️
mridc/launch.py 0.00% <ø> (ø)
mridc/utils/exp_manager.py 25.90% <ø> (ø)
mridc/utils/model_utils.py 29.87% <ø> (ø)
.../reconstruction/models/recurrentvarnet/conv2gru.py 94.02% <100.00%> (ø)

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented May 26, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 16.23 🙂 15.71 🙂 -0.52 👍
Method Length 87.17 🙂 86.96 🙂 -0.21 👍
Working memory 11.20 😞 11.10 😞 -0.10 👍
Quality 49.44% 😞 49.77% 😞 0.33% 👍
Other metrics Before After Change
Lines 4315 4306 -9
Changed files Quality Before Quality After Quality Change
mridc/launch.py 29.70% 😞 29.70% 😞 0.00%
mridc/collections/reconstruction/models/dunet.py 52.66% 🙂 52.66% 🙂 0.00%
mridc/collections/reconstruction/models/kikinet.py 45.43% 😞 45.43% 😞 0.00%
mridc/collections/reconstruction/models/lpd.py 42.99% 😞 42.99% 😞 0.00%
mridc/collections/reconstruction/models/vsnet.py 54.94% 🙂 54.94% 🙂 0.00%
mridc/collections/reconstruction/models/recurrentvarnet/conv2gru.py 26.46% 😞 26.60% 😞 0.14% 👍
mridc/core/classes/common.py 47.76% 😞 47.76% 😞 0.00%
mridc/core/classes/modelPT.py 46.27% 😞 47.42% 😞 1.15% 👍
mridc/utils/exp_manager.py 49.75% 😞 49.75% 😞 0.00%
mridc/utils/model_utils.py 67.35% 🙂 67.35% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
mridc/core/classes/modelPT.py ModelPT.maybe_init_from_pretrained_checkpoint 41 ⛔ 465 ⛔ 19 ⛔ 10.73% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
mridc/collections/reconstruction/models/recurrentvarnet/conv2gru.py Conv2dGRU.__init__ 34 ⛔ 310 ⛔ 21 ⛔ 14.38% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
mridc/core/classes/modelPT.py ModelPT.setup_optimization 45 ⛔ 525 ⛔ 13 😞 15.78% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
mridc/core/classes/common.py Serialization.from_config_dict 40 ⛔ 231 ⛔ 19 ⛔ 16.92% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
mridc/utils/exp_manager.py exp_manager 28 😞 437 ⛔ 16 ⛔ 18.80% ⛔ 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:

  • ⭐ 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!

@sonarcloud
Copy link

sonarcloud bot commented May 26, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wdika wdika merged commit 80291c0 into main May 26, 2022
@wdika wdika deleted the sourcery/main branch May 26, 2022 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant