Skip to content

Fix issue 87, 88, 90, and 91 #92

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

Merged
merged 10 commits into from
Jan 18, 2025
Merged

Fix issue 87, 88, 90, and 91 #92

merged 10 commits into from
Jan 18, 2025

Conversation

rahlk
Copy link
Collaborator

@rahlk rahlk commented Jan 15, 2025

This pull request add a static cyclomatic complexity computation (issue #91) and fixed the mangled comments in constructor declarations (issue #90)

Also addressed issues #88 and #87. There, I found that when executing Maven wrapper using its absolute path (/path/to/codeanalyzer-failing-projects/portfolio-spring/mvnw), it was looking for just .mvn/wrapper files in the wrong working directory, causing a ClassNotFoundException.

I fixed this by splitting the absolute command path into directory and filename components. Now ProcessBuilder uses the command's parent directory as the working directory and the filename as the command.

// Before: Using wrong working directory
Process process = new ProcessBuilder(command, "--version").start();

// After: Split command path to get correct working directory
Process process = new ProcessBuilder()
    .directory(new File(projectRootPom))  // Use mvnw's directory
    .command(commandFile.getName(), "--version")  // Use just "mvnw"
    .start();

I checked to make sure this applied to gradlew projects as well, and I made sure that the gradlew path is absolute.

@rahlk rahlk requested a review from sinha108 January 15, 2025 23:53
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
@rahlk rahlk requested a review from fabio-franco January 15, 2025 23:56
@rahlk
Copy link
Collaborator Author

rahlk commented Jan 15, 2025

@fabio-franco please try to build and verify if the changes in this branch passes regression tests.

rahlk added 2 commits January 16, 2025 05:27
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
@rahlk rahlk changed the title Fix issue 87 and 88 Fix issue 87, 88, 90, and 91 Jan 16, 2025
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
@rahlk rahlk merged commit 8bdbace into 1.X.X Jan 18, 2025
1 check passed
@rahlk rahlk deleted the fix-issue-87 branch February 8, 2025 06:01
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.

2 participants