TypeScript files not instrumented [potential bug]

  • SonarQube 8.5.0.37579

  • SonarScanner 4.5.0.2216-windows

  • I want to measure metrics from the TypeScript-project [https://github.com/microsoft/TypeScript] for commit 1d2730790e00e2780e0771fe876194e2f859a933, but I do not get values for the file Typescript/src/compiler/checker.ts. The file is listed in the corresponding tsconfig.ts.

  • I have run SonarQube-Server and then the SonarScanner.bat: sonar-scanner.bat -Dproject.settings=./config/TypeScript.properties with the following TypeScript.properties

    sonar.projectKey=TypeScript
    sonar.login=eb2162ce7521f04f715ee2960606468db56a64b9
    sonar.host.url=http://localhost:9000
    sonar.projectBaseDir=./TypeScript
    sonar.sources=src
    sonar.sourceEncoding=UTF-8

Before I want to open a topic in the bug-category I want to ask if I have done something wrong. Usually measuring is working. Other files also have values in the webserver.

Hi,

Welcome to the community!

You say you don’t get values for a certain file. Is it recognized as part of analysis? (I.e. does it show up at all in SonarQube?) Do you get values for other files? Are there errors in your analysis log?

Also, given the GitHub repo you’ve linked to, I find this analysis property suspect:

You only need to set this property in extreme circumstances. You should be executing analysis from project root, i.e. from within TypeScript with no need to set this property.

 
Ann

Hey,

I do get values for other files. I do not get values for this certain file. This certain file does not show up in SonarQube.
Where can I find the right logfile? If it is sonar.txt I do not get any errors. In terminal output I do not get errors either.

Oh sry, it was another path I did not want to show here :wink: This should not affect the problem though.
Scanning worked with some other commits.

If you would like to test it yourself:

  1. git clone https://github.com/microsoft/TypeScript.git
  2. git checkout 1d2730790e00e2780e0771fe876194e2f859a933
  3. run SonarQube-Server
  4. run SonarScanner with sonar.sources=src
  5. check in webinterface: src/compiler/checker.ts missing - although existing in TypeScript-Project and instrumented by tsconfig.json-File

Greetings
Robert Klinger

Hi Robert,

I cancelled my clone of this after 5min at 60%. :joy:

I don’t suppose you can provide a compact reproducer?

 
Ann

Hey Ann,

thank you for trying. I can provide a smaller reproducer:

  1. git clone https://github.com/penguinsAreFunny/SonarQubeError.git
  2. run SonarQube-Server
  3. run SonarScanner with sonar.source=src
  4. check webinterface: src/compiler/checker.ts missing - although existing in Project.

Greeting
Robert Klinger

Hi Robert,

Thanks for the reproducer. At this point, we need to wait for the specialists to pick up this thread.

 
:smiley:
Ann

Hey Ann,

do you know approximately when a specialist will have a look on this?
It is important for us, because we need to decide in the next 2 weeks whether or how we will use SonarQube for our usecases.

Greetings
Robert

I have explored the error a little bit more.

It seems the bug occurs non-deterministic. I have tried to find the commit in the TypeScript-Repository in which the bug occured first. As I checkt out different commits in a small range around 1d2730790e00e2780e0771fe876194e2f859a933 I sometimes got values for src/compiler/checker.ts in 1d2730790e00e2780e0771fe876194e2f859a933 sometimes not suggesting this could be a bug in potential asynchronous communication between SonarScanner and SonarQube-Server?

Hi,

I doubt it. The scanner requests data to bootstrap analysis, then works independently until it’s ready to submit the analysis report.

 
:woman_shrugging:
Ann