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

Painters without view #143

Merged
merged 9 commits into from
Oct 31, 2020
Merged

Painters without view #143

merged 9 commits into from
Oct 31, 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?

You'll need a View instance to render a canvas.

Issue Number: N/A

What is the new behavior?

No View instance needed to render a canvas. It's just painters.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification!

examples/demo.py Outdated Show resolved Hide resolved
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 31, 2020

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.48 ⭐ 1.52 ⭐ 0.04 👎
Method Length 54.94 ⭐ 53.57 ⭐ -1.37 👍
Working memory 5.87 ⭐ 5.85 ⭐ -0.02 👍
Quality 85.00% 85.18% 0.18% 👍
Other metrics Before After Change
Lines 2526 2396 -130
Changed files Quality Before Quality After Quality Change
examples/demo.py 88.67% ⭐ 88.92% ⭐ 0.25% 👍
examples/exampleitems.py 85.59% ⭐ 88.52% ⭐ 2.93% 👍
gaphas/quadtree.py 87.23% ⭐ 87.23% ⭐ 0.00%
gaphas/segment.py 76.51% ⭐ 76.58% ⭐ 0.07% 👍
gaphas/painter/init.py 89.45% ⭐ 88.42% ⭐ -1.03% 👎
gaphas/painter/boundingboxpainter.py 89.17% ⭐ 89.38% ⭐ 0.21% 👍
gaphas/painter/handlepainter.py 78.14% ⭐ 77.54% ⭐ -0.60% 👎
gaphas/painter/itempainter.py 90.38% ⭐ 92.10% ⭐ 1.72% 👍
gaphas/view/gtkview.py 80.60% ⭐ 80.46% ⭐ -0.14% 👎
gaphas/view/view.py 90.42% ⭐ 89.89% ⭐ -0.53% 👎
tests/test_segment.py 79.44% ⭐ 79.44% ⭐ 0.00%
tests/test_view.py 88.98% ⭐ 89.24% ⭐ 0.26% 👍

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 🙂 850 ⛔ 16 ⛔ 31.96% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view/gtkview.py GtkView.update_back_buffer 22 😞 231 ⛔ 11 😞 35.15% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
gaphas/painter/handlepainter.py HandlePainter._draw_handles 15 🙂 219 ⛔ 13 😞 37.81% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view/gtkview.py GtkView.update_adjustments 6 ⭐ 206 ⛔ 15 😞 44.15% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view/gtkview.py GtkView.get_handle_at_point 18 🙂 149 😞 9 🙂 48.65% 😞 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!

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

@amolenaar amolenaar merged commit 67b186d into master Oct 31, 2020
@amolenaar amolenaar deleted the painters-without-view branch October 31, 2020 22:15
@danyeaw danyeaw added the chore label Nov 1, 2020
@amolenaar amolenaar added this to the 3.0 milestone Nov 17, 2020
@amolenaar amolenaar added this to In progress in Gaphas overhaul via automation Nov 17, 2020
@amolenaar amolenaar moved this from In progress to Done in Gaphas overhaul Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants