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

Update FileUtils.java #364

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

AlexisDrogoul
Copy link
Member

Make sure we do not raise an error when no file is found using the workspace. Fixes #318

Make sure we do not raise an error when no file is found using the workspace
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.02 (6.21 -> 6.19)

  • Declining Code Health: 1 findings(s) 🚩

View detailed results in CodeScene

Comment on lines +160 to +167
for (final String folder : a.getWorkingPaths()) {
IContainer[] containers = ROOT.findContainersForLocation(new Path(folder));
for (IContainer container : containers) {
final String file = findInWorkspace(fp, container, mustExist);
if (file != null) {
DEBUG.OUT("Hit with workspace-based search: " + file);
return file;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Getting worse: Complex Method
constructAbsoluteFilePath increases in cyclomatic complexity from 11 to 12, threshold = 9

Suppress

@@ -9,8 +9,6 @@
********************************************************************************************************/
package gama.core.common.util;

import static java.util.stream.Collectors.toList;

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.93 to 4.96, threshold = 4

Comment on lines +160 to +167
for (final String folder : a.getWorkingPaths()) {
IContainer[] containers = ROOT.findContainersForLocation(new Path(folder));
for (IContainer container : containers) {
final String file = findInWorkspace(fp, container, mustExist);
if (file != null) {
DEBUG.OUT("Hit with workspace-based search: " + file);
return file;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ Getting worse: Deep, Nested Complexity
constructAbsoluteFilePath increases in nested complexity depth from 4 to 5, threshold = 4

@lesquoyb lesquoyb merged commit 5ff2af8 into 2024-06 Oct 28, 2024
5 of 6 checks passed
@lesquoyb lesquoyb deleted the Fix-for-#318-(Error-in-relative-file-paths) branch October 28, 2024 03:25
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.

[Save] index out of bounds when trying to save to a file from a gaml file outside of the workspace
2 participants