I setup a bitbucket pipeline to use sonarcloud. The pipeline says it ran successfully but it doesn’t seemed to have scanned any files. When I navigate to the code tab, and look at the .cs files, it has a —
by the lines of code column. Even though if I click on the file I can see the code.
It looks like you’re using the vanilla SonarScanner CLI. For C#, you need to use the SonarScanner for .NET. Unfortunately, I don’t have the exact syntax of its use in a Bitbucket pipeline to give you.
Thank you for answering, I am running this from my bitbucket pipeline. I do not see a place to use the CLI, just a pipe for sonarcloud-scan. Is there some argument that I am supposed to add to the pipe for dotnet? The link you sent seems to be used from a command line
How do you normally use CLI tools from a Bitbucket pipeline? Presumably you just make sure they’re installed on the build agent and invoke them, right? It will be the same for using the SonarScanner for .NET.
That is correct, but when I configured the project in SonarCloud in the Analysis Method,
I selected bitbucket as the pipeline, and dotnet as the language. The tutorial then told me to add the lines I added. Please see below
Unfortunately, it seems we don’t have a full suite of instructions for BitBucket (a point which I’ll be raising internally). Normally there should be a 5th option there, for .NET / C#. And it would tell you to use the SonarScanner for .NET as I did above.