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

Painter package #139

Merged
merged 5 commits into from
Oct 27, 2020
Merged

Painter package #139

merged 5 commits into from
Oct 27, 2020

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Oct 25, 2020

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?

Issue Number: N/A

What is the new behavior?

  • gaphas.painter is now a package. Each painter has its own module.
  • view (or any other property) can only be set via the constructor
  • Make Painter a prototype.

In Gaphas 2.x, all painters get a view assigned. The new painters should get as little context information as possible. Only the information necessary to operate should be provided.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 25, 2020

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.55 ⭐ 1.65 ⭐ 0.10 👎
Method Length 43.46 ⭐ 44.78 ⭐ 1.32 👎
Working memory 5.81 ⭐ 5.81 ⭐ 0.00
Quality 86.59% 86.31% -0.28% 👎
Other metrics Before After Change
Lines 2955 2551 -404
Changed files Quality Before Quality After Quality Change
examples/demo.py 88.75% ⭐ 88.67% ⭐ -0.08% 👎
examples/simple-box.py 86.25% ⭐ 86.55% ⭐ 0.30% 👍
gaphas/aspect.py 93.88% ⭐ 93.88% ⭐ 0.00%
gaphas/guide.py 84.61% ⭐ 84.63% ⭐ 0.02% 👍
gaphas/segment.py 76.27% ⭐ 76.30% ⭐ 0.03% 👍
gaphas/tool.py 83.91% ⭐ 83.92% ⭐ 0.01% 👍
gaphas/view/gtkview.py 80.61% ⭐ 80.63% ⭐ 0.02% 👍
gaphas/view/view.py 90.39% ⭐ 90.38% ⭐ -0.01% 👎
tests/test_freehand.py 94.23% ⭐ 94.23% ⭐ 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 🙂 866 ⛔ 15 😞 33.08% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphas/view/gtkview.py GtkView.update_back_buffer 14 🙂 217 ⛔ 12 😞 40.34% 😞 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
gaphas/view/view.py View.get_port_at_point 11 🙂 125 😞 13 😞 49.95% 😞 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 03e1b72 into master Oct 27, 2020
@amolenaar amolenaar deleted the painter-package branch October 27, 2020 20:56
@danyeaw danyeaw added the chore label Nov 1, 2020
@amolenaar amolenaar added this to In progress in Gaphas overhaul via automation Nov 17, 2020
@amolenaar amolenaar added this to the 3.0 milestone 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