user image

Rakshit
Published in : 2022-02-25

Static code analysis tools integration with latest Angular version

Angular

I have added TSLint and codelyzer plugins to my visual studio code, but using such plugins code quality is upgraded by around 20-30% only. What other tool should I use?

I searched about it and found that Sonarqube is a really good tool to check code coverage, testing, and the number of changed lines for new commits.

Wherever I search deeply, I found the Sonarqube for Java. Are there any ways to connect Sonarqube with my Angular application for checking code quality and code coverage after running test cases using Jasmine-karma frameworks?

Your valuable opinion will be appreciated!

Comments

Shilpa Date : 2022-03-06

Best answers

10

Best answers

10

Static code analyzer examples are TSLint, Codelyzer, and sonarqube - which are widely used by developers now a days.

You need to install sonarqube to your project, 

npm install sonar-scanner --save-dev

Add your SonarQube property files.


sonar.host.url=http://localhost:9000
sonar.login=admin
sonar.password=admin
sonar.projectKey=demo-app
p
...

And then run your sonarqube to start analysis using following command

npm run sonar

If it gives you error, add below code to your script array inside package.json file.

"sonar": "sonar-scanner"

You can read full detailed documentation here.

Share your thought if this thread fix your issues/requirements.

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

How to calculate distance between two Bluetooth devices?
Publish date: 2022-02-26 | Comments: 1

Tag: Angular

How to reload Angular component without refreshing page?
Publish date: 2022-03-02 | Comments: 1

Tag: Angular

Angular: Change columns to rows, and rows to columns while running a *ngFor loop.
Publish date: 2022-03-06 | Comments: 0

Tag: Angular

Angular: HTML anchor tag with #idref issue
Publish date: 2022-03-01 | Comments: 2

Tag: Angular

How to bind Weekends off to my kendo calendar in Angular?
Publish date: 2022-03-11 | Comments: 2

Tag: Angular