99x-Delivery-Framework / PHR-Code-Analysis

0 stars 1 forks source link

Sonarqube analysis failing or not running properly on TypeScript projects. #10

Open keshav1002 opened 2 months ago

keshav1002 commented 2 months ago

The Sonarqube analysis is not running properly in my Typescript project.

keshav1002 commented 2 months ago

This issue can arise if the project uses a newer version of Typescript that's not supported by the Sonarqube 9.9.5 community edition. As of right now, this specific version supports up to Typescript v4.7. To support later versions of typescript then the Sonarqube version in the script needs to be updated to a newer version. (v10 and above)

By upgrading to v10 you will run into the other limitation mentioned in this issue here, where the report plugin will stop working. To circumvent this issue, you could use the sonardotnetreport.jar file that exists in this repo to generate the reports.

Add the following line to the end of your sonar.sh file to utilize the custom plugin for generating reports. (you can find this same line in the sonar-dotnet.sh file as well)

java -jar sonardotnetreport.jar http://localhost:${SONARQUBE_PORT} ${PROJECT_NAME} $cli_token ${PROJECT_NAME}-dotnet-issues.csv ${PROJECT_NAME}-dotnet-metrics.csv