DEV Community


Running sonarqube to check javascript code(part 2)

shivani15sharma profile image Shivani Sharma ・2 min read

Once SonarQube is running at port 9000, we are done with the sonarqube server setup.

Next we'll be creating a project and generating a token.
Alt Text

Alt Text

Once you click on setup while you give a project name as new-project. Next you need to generate a token.
You can either generate a new token or use existing.

Alt Text
The token is used to identify you when an analysis is performed.

Select the build technology and OS.

Alt Text

In order to run analysis on your project, you will need to download sonar-scanner

Now move to the project folder(terminal) where you want to run analysis like:

cd myprojects/first
Get the path of sonar-scanner from where you have downloaded and unzipped sonar-scanner, mine was /Users/shivani/Downloads/sonar-scanner-

while you are on your project where you want to run the analysis(in my case it is first) just run command
/Users/shivani/Downloads/sonar-scanner- -Dsonar.projectKey=new-project \
-Dsonar.sources=. \ \

the arguments we have passed you can get when you have created generated a token....
Alt Text

Once execution is successful, you will see
Alt Text

And we are done with the sonarqube setup.

Discussion (0)

Editor guide