The main branch has no code

SonarQube version 7.9.1
SonarQube MSBuild scanner version:

Currently, we are having problem a project that show no analysis after build and scan. Logs are showed as success and I could not see any problems. But in the Overview page, it only shows “The main branch has no code” even though there are some in the Code tab page. Please help!

Thank you

Attached build log as well as background task from the project.BackgroundTask.txt (6.1 KB) BuildLog.txt (182.4 KB)

1 Like

Hi @toanvo729,

From the logs, it looks like there is only one MSBuild project file and it contains both product and test code. This is causing the scanner to treat it all as test code, leading to warning about there being no code (and presumably no issues reported in SonarQube either).

See this thread for more information about how the categorisation of code as test/product code is currently done by the Scanner for MSBuild, and how to tell the scanner to treat the whole project file as source code.

1 Like

Thanks for the quick response. I will test it and let you know how it goes.

hi @toanvo729 - did it work in the end?

Hi Andrei,

Did not hear back from our devs yet. But we had a similar issue with MF Cobol application, and we fixed that by adding file suffixes (.pco) to COBOL language.

Hi @toanvo729

Do you have any news from the devs, did they manage to solve the problem?

Thank you,