You are on page 1of 36

Copyright © Binayak Prasad Gupta.

Demo 1 – SonarQube Source Code Analysis.

Virtual machines used:

● Windows server 2019

Procedure:

● First open your browser and search for “php gurukul”.

Copyright © Binayak Prasad Gupta.


● Then you will see the following webpage appear

● Then search for “diary” clicking on the search icon.

Copyright © Binayak Prasad Gupta.


● Then after clicking on “Search”. Then select the project as shown in the screenshot.

● Then scroll down and click on “Download Source Code” as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then you will see the pop up appears after the download completes.

● Then open a search in google and search for “jdk-17.0.8 download”

Copyright © Binayak Prasad Gupta.


● Then click on the first link as shown in the screenshot.

● Then click on the link for downloading “Windows x64 MSI Installer”

● Then we will see the download starts and gets completed.

Copyright © Binayak Prasad Gupta.


● Then open the downloads folder to check the downloads.

● Then right-click on “e-DMS” then click on “Extract files” as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then click on “OK” when the window appears.

● Then open google chrome web-browser and search for “sonarqube download” then click on the first search
that appears as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then click on “Download for free”.

● Then you will see the download gets started.

Copyright © Binayak Prasad Gupta.


● Now open the directory where your “jdk setup” has been downloaded. Click on it to install “Java Development
Kit” in windows. After the setup appears click on “Next”.

● Then again click on “Next”

Copyright © Binayak Prasad Gupta.


● Then after completion click on “Close”

● Then after download open the directory where it got downloaded the right click on the downloaded file and
then click on “Extract files”.

Copyright © Binayak Prasad Gupta.


● Then click on “Ok” when the window appears

● Then you will see the extraction completed. Then open the folder as shown the screenshot.

Copyright © Binayak Prasad Gupta.


● Then again click on the file as shown in the screenshot.

● Then click on “bin”.

Copyright © Binayak Prasad Gupta.


● Then press shift + right click on “windows-x86-64” and then select “Open PowerShell window here”.

● Then you will see the powershell window appearing.

Copyright © Binayak Prasad Gupta.


● Then use command: “.\StartSonar.bat” and hit enter.

● Now open the following folder as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then copy the “edms” folder present inside.

● Then copy the file into “C:\inetpub\wwwroot” directory as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Now click on the windows search icon and search for “IIS” and then click on the result found as shown in the
screenshot.

● Then you will see the IIS manager opening as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then select the “WIN” and expand “sites” using the arrow beside it as shown in the screenshot.

● Now delete the sites that were present earlier by right clicking on the websites and clicking on “Remove” as
shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● After removing every website, it will look like this as shown in the screenshot.

● Then right click on “Sites” and then select “Add website” as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then “Add Website” window appears. Then enter the “site name”, “physical path”, “Binding”. Select type as
“http”, enter IP address as [the ip address of the windows machine] Here it is “192.168.1.9” and then select
port as “80”. Then click “OK”.

● Then you will see the following as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then open a web-browser and search for “http://192.168.1.9/”

● Then you will see the following screenshot which means the website is correctly created.

Copyright © Binayak Prasad Gupta.


● Now search for “http://localhost:9000/” then you will see the SonarQube web page appearing.

● Now enter username: “admin” and password: “admin” and then click on “Log in”.

● Then a “Update your password” page appears. Enter your old password and the create a new password for
safety. Then click “Update” to update the password change.

Copyright © Binayak Prasad Gupta.


● Then you will see the following page appears.

● Now click on “create a local project” as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Now “Create a local project” window appears. Then fill up the details and click on “Next”

● Now select the “Use the global setting” radio button as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Now scroll down and select “Create Project”

● Then you will see the following window appear as shown in the screenshot.

● Now click on “Locally” as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Then you will see the following page appears. Then click on “generate” to generate a token.

Copyright © Binayak Prasad Gupta.


● Now copy the token and paste it in a notepad. It will be needed later.

● Then click on “Continue”.

● Then click on the highlighted part as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● After opening the official documentation, you will see the following window appear.

● Then click on “Windows 64-bit”

Copyright © Binayak Prasad Gupta.


● Then you will see the download completed.

● Now open the location the file got downloaded.

Copyright © Binayak Prasad Gupta.


● Now right-click on the selected compressed file then click on “Extract Here” to extract.

Copyright © Binayak Prasad Gupta.


● Now open the extracted folder and then click on bin

● Then open the location “C:\inetpub\wwwroot” where the “edms” file is stored.

Copyright © Binayak Prasad Gupta.


● Now copy the file into the bin folder as shown in the screenshot.

● Now copy the code from webpage as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Also paste this in a notepad as shown in the screenshot.

● Make sure to add “./” before the command.

Copyright © Binayak Prasad Gupta.


● Now add “./edms” as shown in the screenshot.

● Now copy the command. Then open the folder where you copied the edms folder and shift + right-click on it
then click for “Open PowerShell window here”.

Copyright © Binayak Prasad Gupta.


● Then paste the command copied in the notepad earlier as shown in the screenshot.

● Then hit enter you will see the scanning started.

● After scanning you will receive a link as shown in the screenshot.

Copyright © Binayak Prasad Gupta.


● Copy and open the link in the browser. Then you will see the analysis summary of your site.

● Now click on “Measures” to view more summary.

● Overall, SonarQube is a valuable tool for development teams striving to maintain high-quality code and reduce
technical debt in their projects. It is a key component in modern software development practices, aiding in the
delivery of reliable and secure software.

Copyright © Binayak Prasad Gupta.

You might also like