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

refactor: Filter and solve warnings in tests #607

Merged
merged 3 commits into from
May 1, 2022

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented May 1, 2022

No description provided.

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/607

)

* 'Refactored by Sourcery'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Sourcery AI <>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/607

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 1, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.88 ⭐ 1.88 ⭐ 0.00
Method Length 50.39 ⭐ 49.78 ⭐ -0.61 👍
Working memory 6.75 🙂 6.81 🙂 0.06 👎
Quality 76.72% 76.59% -0.13% 👎
Other metrics Before After Change
Lines 1621 1645 24
Changed files Quality Before Quality After Quality Change
package/PartSeg/common_gui/colormap_creator.py 76.30% ⭐ 76.26% ⭐ -0.04% 👎
package/PartSegCore/utils.py 82.05% ⭐ 81.99% ⭐ -0.06% 👎
package/PartSegCore/color_image/base_colors.py 66.21% 🙂 81.83% ⭐ 15.62% 👍
package/tests/test_PartSeg/test_colormap_create.py 69.75% 🙂 68.20% 🙂 -1.55% 👎
package/tests/test_PartSeg/test_main_windows.py 72.25% 🙂 73.10% 🙂 0.85% 👍
package/tests/test_PartSeg/test_viewer.py 72.92% 🙂 72.95% 🙂 0.03% 👍
package/tests/test_PartSegCore/test_class_generator.py 82.30% ⭐ 82.29% ⭐ -0.01% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
package/PartSeg/common_gui/colormap_creator.py ColormapList.refresh 8 ⭐ 204 😞 13 😞 45.06% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/common_gui/colormap_creator.py ChannelPreview.__init__ 5 ⭐ 252 ⛔ 12 😞 46.58% 😞 Try splitting into smaller methods. Extract out complex expressions
package/tests/test_PartSeg/test_colormap_create.py TestColormapList.test_image_view_integration 8 ⭐ 196 😞 9 🙂 52.92% 🙂 Try splitting into smaller methods
package/tests/test_PartSeg/test_colormap_create.py TestColormapCreator.test_distribute 2 ⭐ 215 ⛔ 11 😞 53.44% 🙂 Try splitting into smaller methods. Extract out complex expressions
package/tests/test_PartSeg/test_colormap_create.py TestColormapCreator.test_add_color 0 ⭐ 229 ⛔ 10 😞 56.44% 🙂 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

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/607

@Czaki Czaki merged commit 6e5fee8 into develop May 1, 2022
@Czaki Czaki deleted the refactor/clean_test_warnings branch May 1, 2022 10:46
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