7

We have migrated our frontend project from ionic/es6/angular to ionic2/typescript/angular2. Everything is good except we don't know how to run sonar report on the project.

Previously we are using gulp and run gulp sonar command to generate the sonar report (on an local sonar server).

We don't use gulp in the new ionic2 project and wonder how to run the sonar scanner on the new project.

Note

  1. we have installed typescript plugin on our sonar server.
  2. we have added sonar-project.properties file in the project rood directory

Question is how to run it

Thanks...

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Gelin Luo
  • 14,035
  • 27
  • 86
  • 139
  • Have you tried the [SonarQube Scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner)? – G. Ann - SonarSource Team May 26 '17 at 11:55
  • @G.Ann-SonarSourceTeam thanks for your information. I've installed sonar-scanner and now it can run through the sonar report. However I found the report is perfect with no bug, no vulnerabilities, no code smells absolutely perfect, even I creates a bug deliberately, it still turns out nothing. I checked my sonar setting, and I am sure the rules are activated, the project is linked to a quality profile (typescript). Any idea? – Gelin Luo May 29 '17 at 06:34
  • 1) What extension do your files use? 2) What does your analysis log tell you about how your project is being processed? – G. Ann - SonarSource Team May 29 '17 at 20:24
  • @G.Ann-SonarSourceTeam 1) `.ts`, 2) yes it come up with the number of LoC – Gelin Luo May 30 '17 at 03:51
  • @GelinLuo: Please do share the contents of sonar-project.properties.file. – SRCM Dec 12 '17 at 04:07
  • @GelinLuo Did you get anything works? I am facing the same issue. – AlpeshVasani Jan 31 '19 at 08:16

2 Answers2

0

You can download the sonar-scanner tool from sonar and run it in the project folder:

sonar-scanner \
  -Dsonar.projectKey=your-project \
  -Dsonar.organization=your-org \
  -Dsonar.sources=. \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.login=8ed524debb4f53489e99bd66eb5110a3e8c2958e

Personally, I used my repositories pipelines to do the scan.

-5

the answer you are finding is has been already solved

in that link i am giving you

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner

check it out

THEDEAD
  • 1
  • 4
  • 1
    The link you shared is an obvious thing and most Sonar user (including me) has already read it. There is nearly no value in the answer you put. Please do NOT post obvious thing just to get the bounty points. – Gelin Luo Jun 27 '17 at 00:31