Sonarcloud only finds a small part of my code

I’m not sure if I’m doing something wrong. I’ve searched around but am quite confused by documentation that says differently in different places. Right now only a little XML and HTML is picked up.

Another contributor to the project I’m working on has set up a sonarcloud account here, and it seems to work: https://sonarcloud.io/dashboard?id=ismisepaul_SecurityShepherd

Thanks!

Hi @etnoy, welcome to the community forum!

It seems you are using automatic analysis. This mode of analysis does not support analyzing Java files.

I recommend you set-up analysis through a CI system, you can find the docs for that here.

Hope that helps,
Tom

Thanks. That seems to be a correct diagnosis. However, I am not sure on how to change this. When I set up the sonarcloud project, I did not click on automatic analysis, but on Travis-CI and followed the instructions. To try again, I deleted the project on sonarcloud, re-created it, clicked on travis-ci, and am getting the same results. The linked docs are very vague on what I need to do (change pom.xml? add .sonarcloud.properties?) and I am not getting anywhere.

How can I turn of automatic scanning? I’m very confused.

Hi @etnoy,

Automatic analysis is currently in beta, and is activated by the presence of a .sonarcloud.properties file in the root directory of the project. If you rename this file to sonar-project.properties, you can use that file to set-up the analysis in your CI.

Hope that helps,
Tom

Thanks. I got it to work over the weekend, don’t remember exactly what did the trick, but I did remove the .sonarcloud.properties file, and that is probably the right solution.

Perhaps there should be an indicator to which analysis is used? In the UI, I clicked on “Travis” instead of “Automatic Analysis” when setting up the project which made think I did not use automatic analysis.