Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Unable to analyze code #57

Open
ghost opened this issue Feb 28, 2018 · 7 comments
Open

Unable to analyze code #57

ghost opened this issue Feb 28, 2018 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 28, 2018

I used build-and-deploy.sh to create a new objc plug-in, but after the replacement, I couldn't analyze the code on SonarQube-6.7.1, and the data I saw in the console was all 0.

@ghost ghost changed the title Unable to analyze cod Unable to analyze code Mar 7, 2018
@CRoig
Copy link

CRoig commented Mar 15, 2018

Same problem here.

@raatiniemi
Copy link

I assume you both are using OCLint? There seems to be an issue with the OCLint report parser, I've opened a pull request (#61) that should allow for OCLint reports to be parsed.

@Pavel87
Copy link

Pavel87 commented Mar 15, 2018 via email

@CRoig
Copy link

CRoig commented Jul 5, 2018

Actually, there is no error. If I run the OCLint I get 3k vulnerabilities but I can not see any on SonarQube dashboard.

I am not sure if it is related, but I found out two things that can be the origin of the problem.

  1. When running sonar-scanner, I don't see any objc files to be analysed. While I can see some files to analyse on other languages as for example JavaScript.
  2. When running sonar-scanner, I see a java exception "Lizard report could not be found".

Upgraded to 7.2.1 and same issue. Happening the same with backelite sonar-swift plugin.

Can you please help?

@raatiniemi
Copy link

@CRoig The issue with OCLint violations not being reported to SonarQube have been fixed in PR #61, however no maintainer have given any feedback nor merged the PR yet.

Is your project configuration correct? E.g. correct path to source? Check the sonar-project.properties for guidance.

The second issue you mentioned is related to the Lizard complexity reporting, which also have been resolved in PR #60 (with same status as previous PR).

@CRoig
Copy link

CRoig commented Jul 6, 2018

@raatiniemi Thanks for the answer. I have to admit the I misunderstood how backelite plugins have to be used. I was running sonar-scanner instead of run-sonar.sh shell scripts on the plugin.

My project is mixed ObjC and Swift. The swift analysis using run-sonar-swift.sh is perform properly and results are posted on SonarQube dashboard.

Wether installing master branch or #61 branch, it fails to create oclint report file. The error stands for:

oclint: error: cannot open report output file /Users/***/Documents/***/sonar-reports/.-oclint.xml

@raatiniemi
Copy link

@CRoig I haven't used the run-sonar.sh script (I have configured everything using fastlane and sonar-project.properties), can you verify that the OCLint report is located at the path in the error message? It would seem that either the report is not created or it's unreadable (permission wise).

How is your project configured? Does the value for sonar.objectivec.oclint.report point to a valid report file?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants