How do I add code to my Sonarcloud project?

github

(Vjh) #1

I connected my project to my Github source code, ran the analyzer and it ran successfully in my command prompt.

However, it still show’s that my project is empty, and has no code.

How do I add my code to the Sonarcloud project dashboard?

Why doesn’t the documentation cover this? It just tells you to go straight to analyze the code, nothing about how I tell Sonarcloud where my code is or how I import it.


(Grégoire Aubert) #2

Hello,
If you connected you project via Github and ran the scanner that should be it, after a short time of processing you should see the code, issues and measures of your project.
Could you share the command that you used to start the analysis ?


(Nicolas Bontoux) #4

Hi,

Similarly to this thread, it’s worth noting that for the time being the SonarCloud-GitHub integration does not automatically pull your code from GitHub. For now it still is your responsibility to launch the SonarQube scanner on an actual checkout of your code. Full details in the GitHub integration documentation (see notably the ‘trigger analysis’ part).


(Vjh) #5

That does answer my question! I did not run the analysis inside the directory where my code lives.

The instructions could be more clear. When you connect your Github project to a website, you assume you don’t need to provide the code again. Seems a bit counterintuitive.

Thanks.