Skip to content

Feature: Project Class (Sourcery refactored)#870

Closed
sourcery-ai[bot] wants to merge 8 commits intomainfrom
sourcery/pull-869
Closed

Feature: Project Class (Sourcery refactored)#870
sourcery-ai[bot] wants to merge 8 commits intomainfrom
sourcery/pull-869

Conversation

@sourcery-ai
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Oct 17, 2021

Pull Request #869 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/869/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!

@github-actions
Copy link
Contributor

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

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
4.5% 4.5% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2021

Benchmark is done. Checkout the benchmark result page.
Benchmark differences below 5% might be due to CI noise.

Benchmark diff v0.5.0 vs. main

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [89046e0a]       [49a3b5cc]
     <v0.5.0>                   
       63.4±0.5ms       61.0±0.6ms     0.96  BenchmarkOptimize.time_optimize(False, False, False)
         67.4±2ms         104±40ms    ~1.54  BenchmarkOptimize.time_optimize(False, False, True)
       63.6±0.9ms       61.3±0.7ms     0.97  BenchmarkOptimize.time_optimize(False, True, False)
       68.1±0.8ms         67.8±1ms     1.00  BenchmarkOptimize.time_optimize(False, True, True)
       74.7±0.7ms         75.0±1ms     1.00  BenchmarkOptimize.time_optimize(True, False, False)
         111±50ms        78.2±40ms    ~0.70  BenchmarkOptimize.time_optimize(True, False, True)
         76.8±1ms       74.4±0.5ms     0.97  BenchmarkOptimize.time_optimize(True, True, False)
        80.2±20ms         105±30ms    ~1.30  BenchmarkOptimize.time_optimize(True, True, True)
             193M             191M     0.99  IntegrationTwoDatasets.peakmem_optimize
       2.06±0.03s       1.86±0.04s    ~0.90  IntegrationTwoDatasets.time_optimize

Benchmark diff main vs. PR

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [89046e0a]       [49a3b5cc]
     <v0.5.0>                   
       63.4±0.5ms       61.0±0.6ms     0.96  BenchmarkOptimize.time_optimize(False, False, False)
         67.4±2ms         104±40ms    ~1.54  BenchmarkOptimize.time_optimize(False, False, True)
       63.6±0.9ms       61.3±0.7ms     0.97  BenchmarkOptimize.time_optimize(False, True, False)
       68.1±0.8ms         67.8±1ms     1.00  BenchmarkOptimize.time_optimize(False, True, True)
       74.7±0.7ms         75.0±1ms     1.00  BenchmarkOptimize.time_optimize(True, False, False)
         111±50ms        78.2±40ms    ~0.70  BenchmarkOptimize.time_optimize(True, False, True)
         76.8±1ms       74.4±0.5ms     0.97  BenchmarkOptimize.time_optimize(True, True, False)
        80.2±20ms         105±30ms    ~1.30  BenchmarkOptimize.time_optimize(True, True, True)
             193M             191M     0.99  IntegrationTwoDatasets.peakmem_optimize
       2.06±0.03s       1.86±0.04s    ~0.90  IntegrationTwoDatasets.time_optimize

@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-869 branch 5 times, most recently from bde1b53 to 953ad85 Compare December 3, 2021 15:59
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
9.2% 9.2% Duplication

@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-869 branch from 953ad85 to 96a48e2 Compare January 16, 2022 11:52
@sourcery-ai sourcery-ai bot changed the title Feature: Project (Sourcery refactored) Feature: Project Class (Sourcery refactored) Jan 26, 2022
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-869 branch from 96a48e2 to d940ce7 Compare January 26, 2022 22:34
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Jan 26, 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 7.68 ⭐ 7.64 ⭐ -0.04 👍
Method Length 54.41 ⭐ 54.65 ⭐ 0.24 👎
Working memory 8.14 🙂 8.21 🙂 0.07 👎
Quality 67.20% 🙂 67.07% 🙂 -0.13% 👎
Other metrics Before After Change
Lines 2121 2136 15
Changed files Quality Before Quality After Quality Change
glotaran/builtin/io/folder/folder_plugin.py 60.66% 🙂 60.28% 🙂 -0.38% 👎
glotaran/builtin/io/folder/test/test_folder_plugin.py 76.49% ⭐ 75.25% ⭐ -1.24% 👎
glotaran/builtin/io/yml/yml.py 76.54% ⭐ 74.82% 🙂 -1.72% 👎
glotaran/model/item.py 64.34% 🙂 65.09% 🙂 0.75% 👍
glotaran/model/model.py 70.83% 🙂 70.55% 🙂 -0.28% 👎
glotaran/model/property.py 58.53% 🙂 59.35% 🙂 0.82% 👍
glotaran/project/init.py % % %
glotaran/project/generators/generator.py 78.81% ⭐ 78.81% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/model/property.py ModelProperty.glotaran_validate 33 ⛔ 167 😞 12 😞 32.34% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/model/item.py model_item 18 🙂 303 ⛔ 8 🙂 40.95% 😞 Try splitting into smaller methods
glotaran/model/property.py ModelProperty.glotaran_fill 20 😞 133 😞 13 😞 41.71% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
glotaran/model/property.py _model_property_setter_factory 14 🙂 139 😞 14 😞 44.28% 😞 Try splitting into smaller methods. Extract out complex expressions
glotaran/model/item.py model_item.decorator 11 🙂 285 ⛔ 8 🙂 47.39% 😞 Try splitting into smaller methods

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!

@sonarqubecloud
Copy link

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 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sourcery-ai sourcery-ai bot closed this Jan 26, 2022
@sourcery-ai sourcery-ai bot deleted the sourcery/pull-869 branch January 26, 2022 22:42
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.

2 participants