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

Add docs for plugin create (Sourcery refactored) #796

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Nov 15, 2022

Pull Request #795 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 docs/plugin_create branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Czaki November 15, 2022 11:04
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Nov 15, 2022

Sourcery Code Quality Report

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 6.49 ⭐ 6.49 ⭐ 0.00
Method Length 61.47 🙂 61.47 🙂 0.00
Working memory 8.28 🙂 8.28 🙂 0.00
Quality 66.82% 🙂 66.82% 🙂 0.00%
Other metrics Before After Change
Lines 495 495 0
Changed files Quality Before Quality After Quality Change
package/PartSegCore/algorithm_describe_base.py 66.82% 🙂 66.82% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
package/PartSegCore/algorithm_describe_base.py ROIExtractionProfile._pretty_print 21 😞 224 ⛔ 12 😞 34.52% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/algorithm_describe_base.py AlgorithmProperty.__init__ 8 ⭐ 163 😞 14 😞 47.14% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/algorithm_describe_base.py _field_to_algorithm_property 8 ⭐ 162 😞 12 😞 50.22% 🙂 Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/algorithm_describe_base.py Register.__setitem__ 11 🙂 167 😞 9 🙂 52.66% 🙂 Try splitting into smaller methods
package/PartSegCore/algorithm_describe_base.py Register.register 11 🙂 125 😞 10 😞 55.15% 🙂 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!

@deprecated-napari-hub-preview-bot
Copy link

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/796
Updated: 2022-11-15T11:15:49.901994

@sourcery-ai sourcery-ai bot force-pushed the sourcery/docs/plugin_create branch from a21438d to 2311d5b Compare November 15, 2022 11:10
Comment on lines -358 to +362
def __new__(mcs, name, bases, attrs, **kwargs):
def __new__(cls, name, bases, attrs, **kwargs):
methods = kwargs.pop("methods", [])
suggested_base_class = kwargs.pop("suggested_base_class", None)
class_methods = kwargs.pop("class_methods", [])
cls2 = super().__new__(mcs, name, bases, attrs, **kwargs)
cls2 = super().__new__(cls, name, bases, attrs, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function AddRegisterMeta.__new__ refactored with the following changes:

@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Base: 89.83% // Head: 89.83% // No change to project coverage 👍

Coverage data is based on head (2311d5b) compared to base (45fb87d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           docs/plugin_create     #796   +/-   ##
===================================================
  Coverage               89.83%   89.83%           
===================================================
  Files                     195      195           
  Lines                   30036    30036           
===================================================
  Hits                    26984    26984           
  Misses                   3052     3052           
Impacted Files Coverage Δ
package/PartSegCore/algorithm_describe_base.py 86.29% <100.00%> (ø)
package/PartSegImage/image.py 91.86% <0.00%> (ø)

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Czaki Czaki merged commit 4411e64 into docs/plugin_create Nov 16, 2022
@Czaki Czaki deleted the sourcery/docs/plugin_create branch November 16, 2022 13:18
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.

None yet

1 participant