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

Highlight item when a connection can be established #610

Merged
merged 12 commits into from Jan 20, 2021

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Jan 17, 2021

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?

It's not really clear when a

Issue Number: #390

What is the new behavior?

Item is highlighted when a handle can be connected.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Items that need a highlight color:

  • all line-like items
  • Comment
  • Package
  • Initial, final nodes
  • Decision, Fork node
  • Partition
  • Accept, send event node
  • Lifeline
  • Usecase
  • Actor

This wraps up #390, I guess :).

@amolenaar amolenaar changed the title Highlight the element when an element can be connected Highlight item when a connection can be established Jan 17, 2021
@danyeaw danyeaw added the feature A new feature label Jan 18, 2021
@danyeaw danyeaw added this to the 2.2 milestone Jan 18, 2021
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 19, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.50 ⭐ 2.54 ⭐ 0.04 👎
Method Length 46.00 ⭐ 46.80 ⭐ 0.80 👎
Working memory 9.41 🙂 9.46 🙂 0.05 👎
Quality 73.81% 🙂 73.27% 🙂 -0.54% 👎
Other metrics Before After Change
Lines 2070 2131 61
Changed files Quality Before Quality After Quality Change
gaphor/UML/actions/action.py 72.04% 🙂 71.86% 🙂 -0.18% 👎
gaphor/UML/actions/activitynodes.py 75.32% ⭐ 75.20% ⭐ -0.12% 👎
gaphor/UML/actions/partition.py 77.16% ⭐ 77.25% ⭐ 0.09% 👍
gaphor/UML/classes/association.py 66.72% 🙂 65.84% 🙂 -0.88% 👎
gaphor/UML/classes/dependency.py 83.55% ⭐ 83.47% ⭐ -0.08% 👎
gaphor/UML/classes/generalization.py 90.92% ⭐ 88.95% ⭐ -1.97% 👎
gaphor/UML/classes/implementation.py 81.89% ⭐ 81.76% ⭐ -0.13% 👎
gaphor/UML/classes/package.py 68.96% 🙂 68.74% 🙂 -0.22% 👎
gaphor/UML/interactions/lifeline.py 69.75% 🙂 69.30% 🙂 -0.45% 👎
gaphor/UML/profiles/extension.py 86.50% ⭐ 86.50% ⭐ 0.00%
gaphor/UML/states/finalstate.py 75.41% ⭐ 73.41% 🙂 -2.00% 👎
gaphor/UML/states/pseudostates.py 85.24% ⭐ 83.88% ⭐ -1.36% 👎
gaphor/UML/usecases/actor.py 61.54% 🙂 61.42% 🙂 -0.12% 👎
gaphor/UML/usecases/usecase.py 74.33% 🙂 74.14% 🙂 -0.19% 👎
gaphor/diagram/presentation.py 80.72% ⭐ 77.52% ⭐ -3.20% 👎
gaphor/diagram/shapes.py 72.50% 🙂 72.36% 🙂 -0.14% 👎
gaphor/diagram/diagramtools/grayout.py 83.77% ⭐ 85.67% ⭐ 1.90% 👍
gaphor/diagram/general/comment.py 68.26% 🙂 68.09% 🙂 -0.17% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
gaphor/UML/classes/association.py AssociationEnd.post_update 17 🙂 340 ⛔ 19 ⛔ 24.82% ⛔ Try splitting into smaller methods. Extract out complex expressions
gaphor/UML/classes/association.py AssociationItem.post_update 17 🙂 181 😞 14 😞 37.67% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphor/UML/classes/association.py AssociationItem.__init__ 1 ⭐ 185 😞 39 ⛔ 42.41% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphor/UML/actions/activitynodes.py ForkNodeItem.__init__ 4 ⭐ 161 😞 26 ⛔ 43.06% 😞 Try splitting into smaller methods. Extract out complex expressions
gaphor/diagram/shapes.py Box.draw 5 ⭐ 146 😞 19 ⛔ 46.77% 😞 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.

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.

This looks great! I had a big grin on my face when testing this out 🎉

@danyeaw danyeaw merged commit aaaf420 into master Jan 20, 2021
@danyeaw danyeaw deleted the highlight-handle-glue branch January 20, 2021 02:44
@amolenaar
Copy link
Member Author

Thanks 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants