-
Notifications
You must be signed in to change notification settings - Fork 8
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
A better handling of old workspaces (fixes #224) #310
Conversation
When a workspace created with a previous version of GAMA is opened, the dialog now asks if the user wants to update it -- and we clear the old state if yes (prefs of plugins, etc.).
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.26 (8.28 -> 8.02)
- Declining Code Health: 2 findings(s) 🚩
&& openQuestion(null, "Different version of the models library", | ||
"The workspace contains a different version of the models library. Do you want GAMA to proceed and update it ?"); | ||
if (remember) { clearWorkspace(true); } |
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
checkWorkspace increases in cyclomatic complexity from 16 to 17, threshold = 9
@@ -241,8 +241,9 @@ public static Object checkWorkspace() throws IOException { | |||
// this stage | |||
if (ret != null) { | |||
remember = "models".equals(ret) && WorkspacePreferences.askBeforeUsingOutdatedWorkspace() | |||
&& !openQuestion(null, "Different version of the models library", | |||
"The workspace contains a different version of the models library. Do you want to use another workspace ?"); | |||
&& openQuestion(null, "Different version of the models library", |
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.20 to 4.30, threshold = 4
&& openQuestion(null, "Different version of the models library", | ||
"The workspace contains a different version of the models library. Do you want GAMA to proceed and update it ?"); | ||
if (remember) { clearWorkspace(true); } |
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: Deep, Nested Complexity
checkWorkspace has a nested complexity depth of 4, threshold = 4
@@ -246,11 +246,12 @@ public static String checkWorkspaceDirectory(final String workspaceLocation, fin | |||
if (askBeforeUsingOutdatedWorkspace()) { | |||
create = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), | |||
"Different version of the models library", | |||
"The workspace contains a different version of the models library. Do you want to proceed anyway ?"); | |||
"The workspace contains a different version of the models library. Do you want GAMA to proceed and update it ?"); |
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
checkWorkspaceDirectory already has high cyclomatic complexity, and now it increases in Lines of Code from 71 to 72
When a workspace created with a previous version of GAMA is opened, the dialog now asks if the user wants to update it -- and we clear the old state if yes (prefs of plugins, etc.). It should cover 90% of the usages.