'SonarQube Objective-C rule "Functions should be declared explicitly" Not working

I am using SonarQube for objc and have some problems with the rule "objc:S819 – Functions should be declared explicitly". It seems Sonar does not find the path to header files, so the prototypes defined in header file is not visible. How to fix this error?

dispatch_async(dispatch_get_main_queue(), ^{});

Critical issue - Make the prototype of this function visible at this point.

SonarQube Version 6.7.3 (build 38370)

Quality Profile - Sonar Way

Please let me know for more information

Anyone know about the solution please help.

Thanks



Solution 1:[1]

I had the same problem, and finally solved it by deleting old .sonar folders and pointing to the correct one.

I end with different '.sonar' folder (where the scan is stored). The issue was that I was generating the scan in a different folder from where it was parsing it for the report.

Configuration in file 'sonar-project.properties':

sonar.cfamily.build-wrapper-output=../.sonar

Command to execute the scan (since I'm working on macos):

build-wrapper-macosx-x86 --out-dir ../.sonar xcodebuild [PARAMS]

Make sure both relative paths (../.sonar) are pointing to the same absolute path.

It worked for me, hope it does for you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1