-
Notifications
You must be signed in to change notification settings - Fork 5
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
Addresses #257 #303
Addresses #257 #303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: -0.14 (8.51 -> 8.37)
- Declining Code Health: 4 findings(s) 🚩
case KeyboardEventLayerDelegate.SHIFT_MODIFIER -> KEY_SHIFT; | ||
case KeyboardEventLayerDelegate.CMD_MODIFIER -> KEY_CMD; | ||
case KeyboardEventLayerDelegate.CONTROL_MODIFIER -> KEY_CTRL; | ||
case KeyboardEventLayerDelegate.ALT_MODIFIER -> KEY_ALT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Complex Method
getListeningEvent increases in cyclomatic complexity from 18 to 22, threshold = 9
case KeyEvent.VK_SHIFT -> IEventLayerListener.KEY_SHIFT; | ||
case KeyEvent.VK_ALT -> IEventLayerListener.KEY_ALT; | ||
case KeyEvent.VK_CONTROL -> IEventLayerListener.KEY_CTRL; | ||
case KeyEvent.VK_META -> IEventLayerListener.KEY_CMD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ Getting worse: Complex Method
keyPressed increases in cyclomatic complexity from 19 to 23, threshold = 9
case java.awt.event.KeyEvent.VK_SHIFT -> IEventLayerListener.KEY_SHIFT; | ||
case java.awt.event.KeyEvent.VK_ALT -> IEventLayerListener.KEY_ALT; | ||
case java.awt.event.KeyEvent.VK_CONTROL -> IEventLayerListener.KEY_CTRL; | ||
case java.awt.event.KeyEvent.VK_META -> IEventLayerListener.KEY_CMD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Complex Method
getKeyAdapterForAWT increases in cyclomatic complexity from 24 to 28, threshold = 9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally stupid code checks. I get an error when trying to suppress them, @lesquoyb, can you remove these checks ? Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this pr or overall?
Cyclomatic complexity doesn't make sense for big switch methods obviously but I think it's a good indicator for "normal" algorithm complexity.
Anyway the bots are just giving clues on the quality of code and you can merge even if they're not happy
case SWT.COMMAND: | ||
delegate.specialKeyPressed(IEventLayerListener.KEY_CMD); | ||
return; | ||
case SWT.SHIFT: | ||
delegate.specialKeyPressed(IEventLayerListener.KEY_SHIFT); | ||
return; | ||
case SWT.ALT: | ||
delegate.specialKeyPressed(IEventLayerListener.KEY_ALT); | ||
return; | ||
case SWT.CTRL: | ||
delegate.specialKeyPressed(IEventLayerListener.KEY_CTRL); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Complex Method
keyPressed increases in cyclomatic complexity from 12 to 16, threshold = 9
case SWT.COMMAND: | ||
delegate.specialKeyReleased(IEventLayerListener.KEY_CMD); | ||
return; | ||
case SWT.SHIFT: | ||
delegate.specialKeyReleased(IEventLayerListener.KEY_SHIFT); | ||
return; | ||
case SWT.ALT: | ||
delegate.specialKeyReleased(IEventLayerListener.KEY_ALT); | ||
return; | ||
case SWT.CTRL: | ||
delegate.specialKeyReleased(IEventLayerListener.KEY_CTRL); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Getting worse: Complex Method
keyReleased increases in cyclomatic complexity from 11 to 15, threshold = 9
@@ -152,7 +152,18 @@ public void keyPressed(final KeyEvent e) { | |||
case SWT.CR, SWT.KEYPAD_CR: | |||
delegate.specialKeyPressed(IEventLayerListener.KEY_RETURN); | |||
return; | |||
|
|||
case SWT.COMMAND: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ Getting worse: Overall Code Complexity
The mean cyclomatic complexity increases from 4.11 to 4.74, threshold = 4
Two remarks:
Maybe we could add a warning in those cases ? |
I'm merging this pr, I created a new issue for the cases I mentioned above |
Adds common modifiers (shift, alt, ctrl and cmd) to the list of possible triggers for event layers to fix #257