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

Show relationships on top of other elements #1084

Merged
merged 4 commits into from Oct 17, 2021
Merged

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Oct 17, 2021

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Issue Number: #1073

What is the new behavior?

Diagram items are sorted in a way that lines will always be rendered on top, irregardless the nesting structure.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I wanted to solve it by adding sorting ownedPresentation, but that did not work (#1083).

I also did some cleanup.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 17, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.47 ⭐ 1.40 ⭐ -0.07 👍
Method Length 30.52 ⭐ 30.19 ⭐ -0.33 👍
Working memory 5.38 ⭐ 5.35 ⭐ -0.03 👍
Quality 85.82% 86.04% 0.22% 👍
Other metrics Before After Change
Lines 1371 1387 16
Changed files Quality Before Quality After Quality Change
gaphor/core/modeling/diagram.py 88.76% ⭐ 88.51% ⭐ -0.25% 👎
gaphor/core/modeling/element.py 94.13% ⭐ 94.00% ⭐ -0.13% 👎
gaphor/core/modeling/presentation.py 86.56% ⭐ 86.56% ⭐ 0.00%
gaphor/core/modeling/tests/test_diagram.py 94.57% ⭐ 94.94% ⭐ 0.37% 👍
gaphor/services/undomanager.py 82.41% ⭐ 82.74% ⭐ 0.33% 👍
gaphor/services/tests/test_undo_presentation.py 80.69% ⭐ 80.66% ⭐ -0.03% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
gaphor/services/undomanager.py UndoManager.undo_delete_element_event 9 🙂 121 😞 9 🙂 59.53% 🙂 Try splitting into smaller methods
gaphor/services/undomanager.py UndoManager.undo_association_set_event 3 ⭐ 81 🙂 11 😞 66.82% 🙂 Extract out complex expressions
gaphor/services/undomanager.py UndoManager.undo_association_add_event 1 ⭐ 75 🙂 10 😞 71.60% 🙂 Extract out complex expressions
gaphor/services/undomanager.py UndoManager.undo_association_delete_event 1 ⭐ 75 🙂 10 😞 71.60% 🙂 Extract out complex expressions
gaphor/services/undomanager.py UndoManager.undo_attribute_change_event 0 ⭐ 59 ⭐ 11 😞 73.16% 🙂 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!

@amolenaar amolenaar changed the title Ordered presentation Show relationships on top of other elements Oct 17, 2021
@danyeaw danyeaw added the bug An issue in the application label Oct 17, 2021
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 fix and I like the additional cleanups!

@danyeaw danyeaw merged commit a1e6995 into master Oct 17, 2021
@danyeaw danyeaw deleted the ordered-presentation branch October 17, 2021 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue in the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants