By default the supplied ant script will download a copy of your code from Salesforce. You can skip this process if you want (we don’t recommend it because this is a great continuous checking tool).
There are two steps:
You need to disable running tests: Go to SonarQube > Configuration > General Settings > Salesforce, and find the config for Disable running of tests on the force.com platform (sf.disable.testrunner), and set it to ‘true’ to disable.
Instead of running
ant -f ../antbuild.xml analyzefrom your project, you should run:
ant -f ../antbuild.xml sonar– this limits the run to only the SonarQube analysis phase, instead of doing the default download, etc