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

Feature/moverelationsandconstraints (Sourcery refactored) #735

Closed
wants to merge 12 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jul 3, 2021

Pull Request #734 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/glotaran/pyglotaran pull/734/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 review from joernweissenborn, jsnel and a team as code owners July 3, 2021 23:20
@sourcery-ai sourcery-ai bot requested a review from s-weigand July 3, 2021 23:20
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Jul 3, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.71 ⭐ 5.31 ⭐ -0.40 👍
Method Length 80.98 🙂 77.80 🙂 -3.18 👍
Working memory 10.05 😞 10.02 😞 -0.03 👍
Quality 60.42% 🙂 61.42% 🙂 1.00% 👍
Other metrics Before After Change
Lines 3707 3396 -311
Changed files Quality Before Quality After Quality Change
glotaran/analysis/problem.py 82.00% ⭐ 82.09% ⭐ 0.09% 👍
glotaran/analysis/problem_grouped.py 53.35% 🙂 54.85% 🙂 1.50% 👍
glotaran/analysis/problem_ungrouped.py 68.72% 🙂 62.99% 🙂 -5.73% 👎
glotaran/analysis/simulation.py 17.43% ⛔ 21.92% ⛔ 4.49% 👍
glotaran/analysis/util.py 57.57% 🙂 64.96% 🙂 7.39% 👍
glotaran/analysis/test/models.py 66.85% 🙂 66.48% 🙂 -0.37% 👎
glotaran/analysis/test/test_optimization.py 24.77% ⛔ 26.31% 😞 1.54% 👍
glotaran/analysis/test/test_problem.py 59.95% 🙂 61.49% 🙂 1.54% 👍
glotaran/builtin/models/kinetic_image/kinetic_baseline_megacomplex.py 90.73% ⭐ 86.85% ⭐ -3.88% 👎
glotaran/builtin/models/kinetic_image/kinetic_decay_megacomplex.py 65.10% 🙂 64.36% 🙂 -0.74% 👎
glotaran/builtin/models/kinetic_image/test/test_baseline.py 70.07% 🙂 65.39% 🙂 -4.68% 👎
glotaran/builtin/models/kinetic_spectrum/coherent_artifact_megacomplex.py 69.27% 🙂 68.38% 🙂 -0.89% 👎
glotaran/builtin/models/kinetic_spectrum/test/test_coherent_artifact.py 52.26% 🙂 51.69% 🙂 -0.57% 👎
glotaran/builtin/models/kinetic_spectrum/test/test_spectral_penalties.py 45.86% 😞 43.41% 😞 -2.45% 👎
glotaran/builtin/models/spectral/spectral_megacomplex.py 73.47% 🙂 71.44% 🙂 -2.03% 👎
glotaran/builtin/models/spectral/test/test_spectral_model.py 56.65% 🙂 56.65% 🙂 0.00%
glotaran/model/init.py % % %
glotaran/model/dataset_descriptor.py 83.20% ⭐ 86.28% ⭐ 3.08% 👍
glotaran/model/decorator.py 63.07% 🙂 62.16% 🙂 -0.91% 👎
glotaran/model/megacomplex.py 93.31% ⭐ 94.50% ⭐ 1.19% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/analysis/simulation.py simulate 24 😞 318 ⛔ 20 ⛔ 19.82% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/test/test_optimization.py test_optimization 19 😞 529 ⛔ 14 😞 26.31% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/problem_ungrouped.py UngroupedProblem._calculate_residual_for_problem 16 🙂 355 ⛔ 16 ⛔ 27.91% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/model/decorator.py model 14 🙂 282 ⛔ 19 ⛔ 29.01% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/analysis/problem_grouped.py GroupedProblem._append_to_grouped_bag 8 ⭐ 286 ⛔ 22 ⛔ 32.50% 😞 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!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2021

Binder 👈 Launch a binder notebook on branch glotaran/pyglotaran/sourcery/pull-734

@s-weigand s-weigand closed this Jul 3, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jul 3, 2021

SonarCloud Quality Gate failed.

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

No Coverage information No Coverage information
21.4% 21.4% Duplication

@s-weigand s-weigand deleted the sourcery/pull-734 branch July 4, 2021 17: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.

3 participants