insideapp-oss / sonar-apple

SonarQube plugin for Swift / Objective-C
Other
97 stars 2 forks source link

No code errors were analyzed #79

Closed FirstDKS521 closed 6 months ago

FirstDKS521 commented 10 months ago

Mac OS 14.0

The latest version of sonar-apple plug-in, the installation location is no problem

Latest version of SonarQube

In the root directory of the project, execute the sonar-scanner command. After success, no code smell related to OC and Swift can be seen on the SonarQube platform. Only js, HTML, and css languages are detected. Why?

gaelfoppolo commented 9 months ago

Hi @FirstDKS521, Can you share your sonar-project.properties? Did you run any xcodebuild command before sonar-scanner like explained in the README?

FirstDKS521 commented 9 months ago

Hi @FirstDKS521, Can you share your sonar-project.properties? Did you run any xcodebuild command before sonar-scanner like explained in the README?

sonar-project.properties: sonar.token=xxx sonar.host.url=http://localhost:9000 sonar.projectKey=aaa sonar.projectName=aaa sonar.apple.workspace=aaa.xcworkspace sonar.apple.project=aaa.xcodeproj sonar.sourceEncoding=UTF-8

I did not execute the xcodebuild command before executing sonar-scanner; Because even if the xcodebuild command is executed, the generated compile_commands.json file is larger than 20M and cannot be uploaded; Let's look at the sonar documentation. The sonar-scanner command can directly scan the source code and does not rely on the compile_commands.json file, right? Thanks~

gaelfoppolo commented 9 months ago

Well first, your sonar-project.properties is missing sonar.sources or sonar.tests so you might want to check that first. See the example one in the README.

Sonar is indexing the code source yes, but it does nothing else. It's the plugin that does the scanning, gather the results and then upload them to SonarQube, at the end of the analysis.

As explained at the top of the README, each feature provided by the plugin require a tool. You don't have to run xcodebuild, but you will miss the majority of information that this plugin provide.

Please:

You can launch sonar-scanner -X to get debug log and get a better understanding of your issues.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

pravindodia commented 5 months ago

+1