7

I am trying to integrate lizard to track the code complexity of an android app on sonarqube. The command used to get the complexity report from lizard is:

lizard src/main -x"./test/*" -x"./androidTest" --xml >lizard/lizardReport.xml 

In the build.gradle file of the app, the sonarqube properties are configured as follows:

sonarqube { 
  properties { 
    property "sonar.sourceEncoding", "UTF-8" 
    property "sonar.host.url", "https://a.com/“ 
    property "sonar.login", “abc”  property "sonar.password", “abc”  property "sonar.projectKey", "abcd" 
    property "sonar.projectName", "ABCD" 
    property "sonar.projectVersion", android.defaultConfig.versionName  property "sonar.sources", "./src/main" 
    property "sonar.exclusions", "**/*test*/**,build/**,*.iml,**/*generated*" 
    property "sonar.tests", "./src/test/" 
    property "sonar.test.inclusions", "**/*test*/**" 
    property "sonar.import_unknown_files", true  property "sonar.java.lizard.report", "lizard/lizardReport.xml" 
  }
}

At the end of this setup, I am running the gradle sonarqube command to build the project and run the sonar setup but on viewing the report on the sonarqube dashboard, there is no trend for code complexity.

Is there something I am missing here?

Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
Gurunath Sripad
  • 1,308
  • 2
  • 14
  • 24

1 Answers1

0

sonarqube {
properties {
    property "sonar.sourceEncoding", "UTF-8"
    property "sonar.host.url", "https://a.com/"
    property "sonar.login", "abc"
    property "sonar.password", "abc"
    property "sonar.projectKey", "abcd"
    property "sonar.projectName", "ABCD"
    property "sonar.projectVersion", android.defaultConfig.versionName
    property "sonar.sources", "./src/main"
    property "sonar.exclusions", "**/*test*/**,build/**,*.iml,**/*generated*"
    property "sonar.tests", "./src/test/"
    property "sonar.test.inclusions", "**/*test*/**"
    property "sonar.import_unknown_files", true
    property "sonar.java.lizard.report", "lizard/lizardReport.xml"
}
}

Removed the extra quotation mark after the SonarQube host URL "https://a.com/“ --> "https://a.com/"

  • eplaced the curly quotation marks (“ and ”) around the values of sonar.login and sonar.password with regular double quotation marks (")

  • removed the extra space before property "sonar.java.lizard.report", "lizard/lizardReport.xml" for consistency.

  • check the corrected properties are correctly placed within the sonarqube block in your build.gradle file.

dincer.unal
  • 67
  • 1
  • 2
  • 13