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

Add type information #120

Merged
merged 4 commits into from
Oct 10, 2020
Merged

Add type information #120

merged 4 commits into from
Oct 10, 2020

Conversation

amolenaar
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

Make gaphas somewhat (type) saver.

Sourcery AI and others added 2 commits October 10, 2020 15:15
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 10, 2020

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.49 ⭐ 1.48 ⭐ -0.01 👍
Method Length 39.34 ⭐ 39.32 ⭐ -0.02 👍
Working memory 5.51 ⭐ 5.52 ⭐ 0.01 👎
Quality 87.76% 87.75% -0.01% 👎
Other metrics Before After Change
Lines 6250 6271 21
Changed files Quality Before Quality After Quality Change
examples/demo.py 89.08% ⭐ 89.17% ⭐ 0.09% 👍
gaphas/aspect.py 93.90% ⭐ 93.90% ⭐ 0.00%
gaphas/canvas.py 90.42% ⭐ 90.32% ⭐ -0.10% 👎
gaphas/constraint.py 85.10% ⭐ 85.08% ⭐ -0.02% 👎
gaphas/decorators.py 82.27% ⭐ 82.29% ⭐ 0.02% 👍
gaphas/guide.py 84.08% ⭐ 84.20% ⭐ 0.12% 👍
gaphas/item.py 89.21% ⭐ 89.06% ⭐ -0.15% 👎
gaphas/painter.py 88.90% ⭐ 88.90% ⭐ 0.00%
gaphas/quadtree.py 87.53% ⭐ 87.53% ⭐ 0.00%
gaphas/segment.py 70.82% 🙂 76.30% ⭐ 5.48% 👍
gaphas/solver.py 92.75% ⭐ 92.49% ⭐ -0.26% 👎
gaphas/table.py 74.43% 🙂 74.43% 🙂 0.00%
gaphas/tool.py 83.62% ⭐ 83.60% ⭐ -0.02% 👎
gaphas/tree.py 90.74% ⭐ 90.40% ⭐ -0.34% 👎
gaphas/view.py 85.81% ⭐ 85.76% ⭐ -0.05% 👎
tests/conftest.py 91.33% ⭐ 91.33% ⭐ 0.00%
tests/test_element.py 84.64% ⭐ 84.64% ⭐ 0.00%
tests/test_pickle.py 88.92% ⭐ 88.92% ⭐ 0.00%
tests/test_state.py 91.92% ⭐ 91.92% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
examples/demo.py create_window 9 🙂 1001 ⛔ 15 😞 33.07% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/constraint.py EquationConstraint._solve_for 23 😞 149 😞 12 😞 39.46% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gaphas/view.py GtkView.update_back_buffer 14 🙂 221 ⛔ 12 😞 40.08% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/painter.py HandlePainter._draw_handles 15 🙂 206 ⛔ 12 😞 40.27% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view.py GtkView.update_adjustments 6 ⭐ 206 ⛔ 15 😞 44.15% 😞 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@amolenaar amolenaar merged commit ea58d67 into master Oct 10, 2020
@danyeaw danyeaw added the chore label Nov 1, 2020
@danyeaw danyeaw deleted the add-type-information branch February 22, 2021 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants