-
Notifications
You must be signed in to change notification settings - Fork 275
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
[Bug] SonarScanner errors out due an exception in sonar-swift plugin when source path has a space #208
Labels
Comments
I am facing the same issue. However I do not have the spaces in project path. |
So am I |
+1 |
2 similar comments
+1 |
+1 |
I am facing the same issue. So my workaround is as follows
public SwiftFunction(String name) {
//String[] vals = name.split(" ");
String[] vals = name.split(" at ");
//if(vals.length >= 3){
if(vals.length >= 2){
this.name = vals[0].substring(0,vals[0].indexOf("("));
//this.file = vals[2].substring(0,vals[2].lastIndexOf(":"));
//this.lineNumber = Integer.parseInt(vals[2].substring(vals[2].lastIndexOf(":")+1));
this.file = vals[1].substring(0,vals[1].lastIndexOf(":"));
this.lineNumber = Integer.parseInt(vals[1].substring(vals[1].lastIndexOf(":")+1));
this.key = file.substring(0,file.lastIndexOf('.')+1)+name;
}else{
this.key = name;
}
} |
Does #207 solves your issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
SonarScanner errors out due an exception in sonar-swift plugin when source path has a space.
To Reproduce
Steps to reproduce the behavior:
Analyze an Xcode project with a space in its path. An example code structure:
Expected behavior
The analysis should complete and results should be published to Sonarqube.
SonarQube environment:
Additional context
Following is the exception:
Probable root-cause is the following code, which assumes that there would not be a path in space:
https://github.com/Backelite/sonar-swift/blob/42831ead6a8e838fe5db28b0430c77209b72603f/sonar-swift-plugin/src/main/java/com/backelite/sonarqube/swift/complexity/LizardReportParser.java#L178-L181
When the path includes space the
name
would include a string similar to :So at Line 181,
val2
would likely have the value./My
instead of complete path and thus it would not find the:
it is seeking.The text was updated successfully, but these errors were encountered: