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

Some changes to section based ring and ViaStacks (Sourcery refactored) #1476

Merged
merged 7 commits into from Mar 24, 2023

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Mar 24, 2023

Pull Request #1475 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/gdsfactory/gdsfactory pull/1475/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 a review from mdecea March 24, 2023 20:26
@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Mar 24, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 12.61 🙂 19.80 😞 7.19 👎
Method Length 203.89 😞 227.40 ⛔ 23.51 👎
Working memory 18.51 ⛔ 18.33 ⛔ -0.18 👍
Quality 34.99% 😞 29.59% 😞 -5.40% 👎
Other metrics Before After Change
Lines 984 1214 230
Changed files Quality Before Quality After Quality Change
gdsfactory/components/ring_section_based.py 20.62% ⛔ 12.26% ⛔ -8.36% 👎
gdsfactory/components/spiral_heater.py 41.91% 😞 41.71% 😞 -0.20% 👎
gdsfactory/components/via_stack.py 36.65% 😞 30.52% 😞 -6.13% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/components/ring_section_based.py ring_section_based 44 ⛔ 786 ⛔ 22 ⛔ 7.51% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/components/via_stack.py circular_via_stack 26 😞 504 ⛔ 17 ⛔ 18.46% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/components/via_stack.py via_stack 22 😞 438 ⛔ 21 ⛔ 18.51% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gdsfactory/components/spiral_heater.py spiral_racetrack 18 🙂 388 ⛔ 23 ⛔ 21.00% ⛔ Try splitting into smaller methods. Extract out complex expressions
gdsfactory/components/via_stack.py via_stack_from_rules 14 🙂 390 ⛔ 18 ⛔ 27.11% 😞 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!

@joamatab joamatab merged commit e56f539 into main Mar 24, 2023
4 of 5 checks passed
@joamatab joamatab deleted the sourcery/pull-1475 branch March 24, 2023 21:54
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

2 participants