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

fix: Fix warnings reported by Deepsource #846

Merged
merged 11 commits into from
Dec 16, 2022
Merged

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Dec 16, 2022

No description provided.

@Czaki Czaki added this to the 0.15.0 milestone Dec 16, 2022
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 16, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.56 ⭐ 4.56 ⭐ 0.00
Method Length 75.94 🙂 75.76 🙂 -0.18 👍
Working memory 7.27 🙂 7.28 🙂 0.01 👎
Quality 67.80% 🙂 67.84% 🙂 0.04% 👍
Other metrics Before After Change
Lines 7235 7237 2
Changed files Quality Before Quality After Quality Change
package/PartSeg/_roi_analysis/batch_window.py 56.26% 🙂 56.19% 🙂 -0.07% 👎
package/PartSeg/_roi_analysis/prepare_plan_widget.py 68.91% 🙂 68.92% 🙂 0.01% 👍
package/PartSeg/common_gui/algorithms_description.py 74.78% 🙂 74.82% 🙂 0.04% 👍
package/PartSeg/common_gui/flow_layout.py 78.82% ⭐ 78.53% ⭐ -0.29% 👎
package/PartSeg/common_gui/napari_image_view.py 63.62% 🙂 63.62% 🙂 0.00%
package/PartSeg/plugins/old_partseg/old_partseg.py 61.69% 🙂 62.26% 🙂 0.57% 👍
package/PartSegCore/class_generator.py 50.25% 🙂 49.11% 😞 -1.14% 👎
package/PartSegCore/analysis/calculate_pipeline.py 73.51% 🙂 72.60% 🙂 -0.91% 👎
package/PartSegCore/analysis/calculation_plan.py 78.00% ⭐ 78.27% ⭐ 0.27% 👍
package/PartSegCore/analysis/batch_processing/batch_backend.py 63.03% 🙂 63.05% 🙂 0.02% 👍
package/PartSegCore/analysis/batch_processing/parallel_backend.py 74.39% 🙂 75.04% ⭐ 0.65% 👍
package/PartSegImage/image_reader.py 57.00% 🙂 58.20% 🙂 1.20% 👍
package/tests/test_PartSeg/test_analysis.py 72.46% 🙂 71.39% 🙂 -1.07% 👎
package/tests/test_PartSeg/test_roi_analysis_batch.py 74.36% 🙂 74.44% 🙂 0.08% 👍
package/tests/test_PartSeg/test_sentry.py 72.57% 🙂 72.81% 🙂 0.24% 👍
package/tests/test_PartSeg/roi_analysis/test_advanced_window.py 67.72% 🙂 67.49% 🙂 -0.23% 👎
package/tests/test_PartSegCore/test_class_generator.py 78.12% ⭐ 77.99% ⭐ -0.13% 👎
package/tests/test_PartSegCore/segmentation/test_segmentation_algorithm.py 74.49% 🙂 73.83% 🙂 -0.66% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
package/PartSegCore/analysis/batch_processing/batch_backend.py FileData.add_data_part 26 😞 301 ⛔ 21 ⛔ 18.56% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/_roi_analysis/batch_window.py CalculationPrepare.showEvent 21 😞 338 ⛔ 19 ⛔ 21.93% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/class_generator.py _make_class 16 🙂 437 ⛔ 22 ⛔ 22.42% ⛔ Try splitting into smaller methods. Extract out complex expressions
package/PartSegCore/analysis/batch_processing/batch_backend.py CalculationProcess.do_calculation 23 😞 307 ⛔ 13 😞 27.85% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/common_gui/napari_image_view.py ImageView.print_info 28 😞 234 ⛔ 13 😞 28.09% 😞 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!

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

deprecated-napari-hub-preview-bot bot commented Dec 16, 2022

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/846
Updated: 2022-12-16T12:13:43.455317

@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Base: 89.92% // Head: 89.97% // Increases project coverage by +0.05% 🎉

Coverage data is based on head (6ad02e0) compared to base (dc92c8e).
Patch coverage: 92.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #846      +/-   ##
===========================================
+ Coverage    89.92%   89.97%   +0.05%     
===========================================
  Files          194      194              
  Lines        30117    30089      -28     
===========================================
- Hits         27082    27072      -10     
+ Misses        3035     3017      -18     
Impacted Files Coverage Δ
package/PartSeg/_roi_analysis/batch_window.py 42.45% <ø> (+0.09%) ⬆️
...ckage/PartSeg/_roi_analysis/prepare_plan_widget.py 91.06% <ø> (+0.10%) ⬆️
package/PartSeg/common_gui/flow_layout.py 85.71% <ø> (-0.19%) ⬇️
package/PartSeg/common_gui/napari_image_view.py 87.61% <ø> (+0.20%) ⬆️
package/PartSeg/plugins/old_partseg/old_partseg.py 39.62% <0.00%> (+0.73%) ⬆️
package/PartSegCore/analysis/calculate_pipeline.py 100.00% <ø> (+2.32%) ⬆️
.../test_PartSeg/roi_analysis/test_advanced_window.py 100.00% <ø> (ø)
...Core/analysis/batch_processing/parallel_backend.py 71.23% <50.00%> (ø)
...ckage/PartSeg/common_gui/algorithms_description.py 94.96% <100.00%> (ø)
...SegCore/analysis/batch_processing/batch_backend.py 88.82% <100.00%> (ø)
... and 10 more

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.

sourcery-ai bot and others added 3 commits December 16, 2022 12:39
Co-authored-by: Sourcery AI <>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@Czaki Czaki merged commit 31a568b into develop Dec 16, 2022
@Czaki Czaki deleted the refactor/clean_warnings branch December 16, 2022 14:08
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