Step 1: Installation of Sonarqube



Download 183,99 Kb.
Sana14.07.2022
Hajmi183,99 Kb.
#801224
Bog'liq
12-amaliy


Step 1: Installation of Sonarqube

  1. Visit https://www.sonarqube.org/downloads/ and download the community edition.


2: It will download Zip folder into your downloaded folder.
Before doing unzip, check the properties of the downloaded folder. It might be blocked for your machine so you need to unblock it and then unzip the folder.
Step 2 - Installation of JDK-
If you want to use open JDK then visit - https://openjdk.java.net/install/ and download it locally.
Step 3 - Visual Studio code
Now open Visual Studio and write down your C # project along with test cases.
Below is the project which I have created for demo configuration.

Step 4
Now, as you have your project ready, you need to install coverlet utility using the below steps-

  • Go to Visual studio extension- Manage extension then search Coverlet Report and install it.

Step 5 - Installation of SonarScanner
Go to developer command prompt and enter the below command-
dotnet tool install --global dotnet-sonarscanner
Step 6
Visit the SonaQube unzipped folder and open the Wrapper config file and enter the JDK path manually before proceeding further.

Step 7
Now you need to start sonarqube using the below command,
startsonar.bat

Step 8
Now browse your project location and open the developer command prompt and enter the below commands to get your Sonarqube integration done-
dotnet sonarscanner begin / k: "Bank_Scan" /d:sonar.login="admin "/d:sonar.password="admin"
Note- By default login Id and Password for Sonarqube is admin and admin respectively.

Step 9
Now, do dotnet build for your project using the below command.
dotnet build
Step 10
Now, after successful build, you need to enter the following commands for creating coverage.opencover.xml file.
dotnet test --collect: "XPlat Code Coverage"
dotnet test / p: CollectCoverage = true / p: CoverletOutputFormat = opencover

Step 11
Now the last step is to end the Sonarscanner by using the below command.
dotnet sonarscanner end /d:sonar.login="admin "/d:sonar.password="admin"
Here, in this step sonarscanner gather all the things which we have completed in the previous steps and generates the code analysis report for us.

Now visit the URL which you get after the above command execution to see the generated report.
http: // localhost: 9000 / is the sonarqube URL.
Here, you need to go to Project settings, Languages - (C #) and in Open cover Integration Test reports- mention the coverage.opencover.xml path.

Now after doing this repeat step 11 and browse the overview section. This will give you the Coverage, code smell for your project.
After clicking on coverage it will show you overall coverage information. You can go through it and check the necessary things and reports as per your need.

In your test project path, you will see the coverage report generated in the JSON format.

Download 183,99 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish