Disparity between Lines and Lines of Code - JS and TS

I’m experiencing the same thing. When I push the typescript project using the command line sonar-scanner to our SonarCloud account, it correctly identifies all the Typescript file as “lines of code”, but when I integrated the exact same project to our Github account, it recognized only the Javascript files as “lines of code” and the rest of the Typescript as simply “lines” (and so no analysis was done):

Screen Shot 2020-02-06 at 11.31.02 AM

Hello Scott,

Welcome to the Sonarsource community forum!

Could you provide to us the following fo each use case:

  • the exact command line you execute
  • the scanner logs

Thanks a lot.

Best.

Where would I find the logs on my SonarCloud project that I integrated directly with Github? I can’t seem to find them anywhere under the project. The one I ran manually from the command line I could run again to share logs, but that one worked fine, the issue is the one integrated with the Github repo, which is the one I’d really like to have working since it would be automatic. I have two other Typescript repos integrated in the same way under our account, and they both work fine, but this one in particular doesn’t. I assumed I could reach out to support to have them check my account and whatever logging exists on the SonarCloud service side, but no joy, they just pointed me back to this forum…

Hello Scott,

When you are talking about “integrated directly with GitHub”, I believe you are talking about the automatic scan of your GitHub repos that is performed by SonarCloud. What we are calling internally AutoScan which became the default mode for illegible repositories recently.

Which version of TypeScript do you use when running the scan locally?

Thanks
Alex

Hi Alex,

When running the scan locally I used the same version specified in the package.json, Typescript 3.5.1. For the other repo’s that worked fine they were using a similar version, 3.5.3 or later.

Thanks,
Scott

Do you still have the problem today? I was notified the TypeScript environment was upgraded on AutoScan/SonarCloud side, so you should have no difference.

Hi Alex,

Thanks for the follow-up, it started working in the last few weeks, so presumably the upgrade resolved the problem.

Thanks,
Scott