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

Fix test discovery issue in VSCode #532

Merged
merged 2 commits into from Dec 1, 2020
Merged

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?

A GdkPixbuf image was loaded on load of the diagrampage module. This caused VSCode test discovery to fail.

What is the new behavior?

Test runs in VSCode work for me again

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@amolenaar amolenaar added the chore Maintenance related PR label Dec 1, 2020
By not loading in image at module level, but via a memoized function.
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 1, 2020

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.91 ⭐ 2.82 ⭐ -0.09 👍
Method Length 46.35 ⭐ 44.70 ⭐ -1.65 👍
Working memory 10.58 😞 10.32 😞 -0.26 👍
Quality 72.27% 🙂 73.14% 🙂 0.87% 👍
Other metrics Before After Change
Lines 386 394 8
Changed files Quality Before Quality After Quality Change
gaphor/ui/diagrampage.py 70.94% 🙂 71.34% 🙂 0.40% 👍
gaphor/ui/tests/test_diagrampage.py 87.06% ⭐ 89.25% ⭐ 2.19% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
gaphor/ui/diagrampage.py DiagramPage._on_drag_data_received 11 🙂 199 😞 27 ⛔ 32.87% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphor/ui/diagrampage.py DiagramPage.set_drawing_style 2 ⭐ 134 😞 16 ⛔ 53.70% 🙂 Try splitting into smaller methods. Extract out complex expressions
gaphor/ui/diagrampage.py DiagramPage._on_shortcut_action 10 🙂 60 ⭐ 15 😞 57.32% 🙂 Extract out complex expressions
gaphor/ui/diagrampage.py DiagramPage.construct 0 ⭐ 148 😞 11 😞 61.24% 🙂 Try splitting into smaller methods. Extract out complex expressions
gaphor/ui/diagrampage.py get_placement_cursor 2 ⭐ 62 🙂 11 😞 70.70% 🙂 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 6c912ab into master Dec 1, 2020
@amolenaar amolenaar deleted the fix-test-runs-in-vscode branch December 1, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant