dlecan
(Damien)
June 22, 2021, 9:33am
1
ALM used: Github
CI system used: CircleCI
Languages of the repository: JS and TS
Only if the SonarCloud project is public, the URL: SonarCloud
As others on this forum (see links below) only JS Javascript files of the project are included in Lines of Code
.
TS Typescript files are only recognized as Linues
.
Background Task ID: AXoT2QN3k_WGqhJSj_sl
The project is a Yarn Workspace and mono-repo built with Lerna.
How to analyze the Typescript files?
Thank you.
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]
Template for a good new topic, formatted with Markdown :
ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
Github
CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
CircleCI
Scanner command used when applicable (private details masked)
Used SonarClouds built in integration with Github private repo
Languages of the repository
Typescript, Javascript
Only if the SonarCloud project is public, the URL
And if you need help with pull request decoration, then the URL to the PR too
…
Hi Guys, I have an issue with SonarCloud and a project that was added through GitHub.
ALM used (GitHub)
CI system used (Sonar Cloud Analyzer BETA)
TypeScript
It’s a private project.
I’m seeing this in the project overview tab even though there is code to analyze:The main branch has no lines of code.
I added the project with the steps specified in SonarCloud Portal, nothing more, nothing less.
There is no workaround as far as I know, I tried navigating all the views in SonarCloud looking for a…
Colin
(Colin)
June 22, 2021, 9:43am
2
Hey there.
In your case Typescript files fail to be analyzed for the following reason:
ERROR: File '@sindresorhus/tsconfig' not found.
INFO: Skipping 1261 files with no tsconfig.json
Indeed, the root tsconfig file your other files extend from only exist once a command like this is run:
npm install --save-dev @sindresorhus/tsconfig
Are you using Automatic Analysis or triggering your analysis through your CI tool (and the execution of sonar-scanner
)
dlecan
(Damien)
June 22, 2021, 2:07pm
3
This one.
Should I switch to sonar-scanner?
Colin
(Colin)
June 30, 2021, 8:11am
5
Hey @dlecan
Sorry this thread fell off my radar!
Yes, switching to CI-based analysis where the tsconfig.json files are available (because you’ve run npm install
or whatever you use to grab this module containing the tsconfig.json file before analysis) would fix the issue.
You could also try having the tsconfig.json file available in your repo so it’s picked up by automatic analysis, but I’m guessing that’s not ideal.
Long-term, we may allow analysis without the tsconfig of the project (although not necessarily targeted for this use-case)
I think it’s an interesting situation. I’ll ping the right team internally for awareness of this scenario.
1 Like
dlecan
(Damien)
June 30, 2021, 2:35pm
7
Ok, I will switch
thank you
system
(system)
Closed
July 7, 2021, 2:36pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.