Flutter SonarQube: "The main branch has no lines of code."

66 Views Asked by At

Trying to run static code analyzer sonarqube for my Flutter project.

Steps currently followed,

  1. Downloaded Sonarqube community version.
  2. Downloaded the SonarQube flutter plugin
  3. Moved the Jar file to the extension/plugins folder, verified it is in the installed plugin in the Sonarqube dashboard.
  4. Downloaded sonar-scanner.
  5. Added the sonar-project.propertise file in the project, refer the code in the below section.
  6. Ran sonar-scanner, logs shows as execution is successful, attached in the below section.

When I go to the Sonarqube dashboard (at, http://localhost:9000), it show an warning saying, The main branch has no lines of code., Not sure what is incorrect here, I tried creating a new flutter project from scratch which doesn't have any VCS, but still same error, stuck on this for quite long.

Logs:

INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://localhost:9000/dashboard?id=test_sonar_flutter
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/api/ce/task?id=45188e45-b98e-40d7-aaed-10f35803fdaf
INFO: Analysis total time: 6.024 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.456s
INFO: Final Memory: 24M/108M
INFO: ------------------------------------------------------------------------

sonar-project.properties

sonar.projectKey=test_sonar_flutter
sonar.projectName=test_sonar_flutter
sonar.login=token (Added token from sonar qube dashbaord)

# The host URL
sonar.host.url=http://localhost:9000
sonar.dart.analyzer.options.override=true


# Source code location.
# Path is relative to the sonar-project.properties file. Defaults to .
# Use commas to specify more than one folder.
sonar.sources=lib,pubspec.yaml
sonar.tests=test

# Encoding of the source code. Default is default system encoding.
sonar.sourceEncoding=UTF-8

# exclude generated files
#sonar.exclusions=test/**/*_test.mocks.dart,lib/**/*.g.dart

Let me know if I am missing any config or something.

Versions:

  • sonar-flutter-plugin: 0.5.0
  • sonar-scanner: 5.0.1.3006
  • sonarqube: 10.14.1
0

There are 0 best solutions below