How do I fix this error? There’s clearly code in the repo. I pushed a non main branch and it created the project in Sonarqube but it gives this error when there’s clearly code in the project. Please fix this error.
Please don’t expect community members to cross-reference your Stackoverflow post. If you’d like to get help here, then you’ll need to post - fully - here.
I didn’t post to stackoverflow. I just tried the answers there and they didn’t work. I want to fix error “The main branch has no lines of code.”
Do i have to push sonar-project.properties to master branch. I’m pushing only a feature branch now. Sonarqube created the project when I pushed, and it gets updated when I push but it doesn’t see any code for some unknown reason. Don’t know what to do the error doesn’t even say where it looked. I don’t understand why it can’t see any code when it’s right there. Do I have to update Jenkins file.
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
Are you saying that when you looked at your analysis log, you found an error about localhost? If so, you can use sonar.host.url to set a non-default SonarQube location.
I already tried setting sonar.host.url to the same URL I use to see the projects. I also set sonar.login and sonar.password with the credentials I use to login to sonar.host.url/session/new but it still doesn’t work I only get Unauthorized. Idk if there’s some special API URL i have to use or something.