Sonar Scan not showing lines of code or coverage with Javascript/Typescript application


  • Using sonar-scanner configured with jest-sonar-reporter
  • SonarQube is deployed locally and via kitt build
  • I am trying to achieve coverage analysis on our application’s source code
  • So far I have updated file - mainly sonar.sources field - currently sonar scanner is only picking up sonar.test.inclusions and only reporting analysis on those test files. The files that we want to be analyzed have a flag in the log with a flag DEBUG: File not part of the project:

Hey there.

What version of SonarQube are you using? You can find this in the footer of your SonarQube instance.

Hi Colin thanks - we are using Version 9.9.1 (build 69595). I found that by adding the field for sonar.inclusions the analysis for lines displayed, however I am unclear of what changed, since it was reporting without needing sonar.inclusions. Here is an idea of what our looks like:


# # Include test subdirectories in test scope

sonar.test.inclusions = 

Our Javascript/Typescript analyzer will try to work out what files belong to a project (and should be analyzed) based on things like your tsconfig.json file – is it possible you have one with some unexpected settings?

Thanks @Colin , it seemed to be an issue with the syntax of the file that needed an update to the sonar.inclusions property - which allowed the analysis to run. I am still trying to understand why this property was needed when analysis was previously executing without it. Any ideas?