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

A better handling of old workspaces (fixes #224) #310

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

AlexisDrogoul
Copy link
Member

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.

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.).
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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) 🚩

View detailed results in CodeScene

Comment on lines +244 to +246
&& 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); }

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

Suppress

@@ -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",

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

Comment on lines +244 to +246
&& 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); }

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

Suppress

@@ -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 ?");

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

@lesquoyb lesquoyb merged commit 96cfe2f into 2024-06 Sep 5, 2024
4 of 6 checks passed
@lesquoyb lesquoyb deleted the Addresses-#224 branch September 5, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants