-
Notifications
You must be signed in to change notification settings - Fork 7
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
Disables the lock when the camera is dynamic #353
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: OK
Change in average Code Health of affected files: -0.02 (9.44 -> 9.42)
- Declining Code Health: 1 findings(s) 🚩
Should fix #350 |
It works, but one side effect is that setting a camera with |
The "dynamic" and "locked" states are now clearly separated in terms of logic. While "dynamic: true" prevents the camera to be manipulated and disables the lock button, "locked: true" will allow the user to overcome the state from the UI.
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.04 (8.00 -> 7.96)
- Declining Code Health: 5 findings(s) 🚩
if (cameraLocked != null) { | ||
boolean locked = view.isCameraLocked(); | ||
boolean dynamic = view.isCameraDynamic(); | ||
tb.setSelection(cameraLocked, locked || dynamic); | ||
// If the camera is dynamic, we disable the control (see #350) | ||
cameraLocked.setEnabled(!dynamic); | ||
} |
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
install increases in cyclomatic complexity from 13 to 14, threshold = 9
@@ -688,7 +688,12 @@ public void setZFar(final Double zF) { | |||
public void update(final IScope scope, final Facets facets) { | |||
|
|||
if (cameraNameExpression != null) { | |||
boolean isLocked = camera == null ? false : camera.isLocked(); |
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.
❌ New issue: Bumpy Road Ahead
update has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function
@@ -144,7 +143,7 @@ public void update(final IScope scope) { | |||
*/ | |||
@Override | |||
public boolean setLocation(final GamaPoint loc) { | |||
if (!isInteractive() || loc == null) return false; | |||
if (isLocked() || isDynamic() || loc == null) return false; |
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.
❌ New issue: Complex Conditional
setLocation has 1 complex conditionals with 2 branches, threshold = 2
@@ -159,7 +158,7 @@ public boolean setLocation(final GamaPoint loc) { | |||
*/ | |||
@Override | |||
public boolean setTarget(final GamaPoint loc) { | |||
if (!isInteractive() || loc == null) return false; | |||
if (isLocked() || isDynamic() || loc == null) return false; |
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.
❌ New issue: Complex Conditional
setTarget has 1 complex conditionals with 2 branches, threshold = 2
|
||
@Override | ||
public boolean setDistance(final Double d) { | ||
if (!isInteractive() || d == null) return false; | ||
if (isLocked() || isDynamic() || d == null) return false; |
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.
❌ New issue: Complex Conditional
setDistance has 1 complex conditionals with 2 branches, threshold = 2
No description provided.