Hi There,
We had been analyzing our code automatically with bitbucket and we had been seeing the results on the board, however, a few days ago we began to see the message “The main branch has no lines of code”, the latest changes we made were: we changed the default branch from master to develop, we created a new Quality Gate and we excluded the test project using the tag true.
BUT if we run the same commands from our local machine (manually) results show up on the board
- ALM used: Bitbucket Cloud
- CI system used: Bitbucket Cloud
- Languages of the repository: .Net Core 3.1
- Scanner command:
dotnet sonarscanner begin /k:“project key” /d:“sonar.login=123” /v:“bitbucket version” /o:organization key" /d:“sonar.host.url=https://sonarcloud.io” /d:sonar.cs.opencover.reportsPaths=“coverage.opencover.xml”
dotnet build
dotnet sonarscanner end /d:“sonar.login=123”
Attached you can find three logs
OldBitbucketLog-WithResults.txt (This is the log we got when we ran the analysis automatically using bitbucket pipeline a few days ago and at that moment we could see results)
BitbucketLog-NoResults.txt (This is the log we got yesterday when running the analysis automatically using bitbucket pipeline and results are not loaded on the board)
LocalAnalysisLog.txt (This is the log we get when running the analysis manually from the local machine and results are loaded to the board)
When I compare the logs (local and bitbucket) I noticed that the following lines do not exist in the log BitbucketLog-NoResults.txt:
INFO: Quality profile for cs: CM Profile
INFO: Sensor C# [csharp]
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 75 source files to be analyzed
INFO: SCM Publisher 75/75 source files have been analyzed (done) | time=646ms
And the following lines show 0 files
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
LocalAnalysisLog.txt (10.7 KB) OldBitbucketLog-WithResults.txt (14.2 KB) BitbucketLog-NoResults.txt (10.4 KB)