Analyze Asp.Net MVC Code Quality with SonarQube in 10 Minutes!

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.ค. 2024
  • In this video we will learn how to analyze ASP.NET/C#/VB.NET project with SonarQube. Code analysis for ASP.NET/C#/VB.NET project in three easy steps. After configure a project in SonarQube, there are three commands which will need to run in Command Line under Solution startup project directory.
    There are some prerequisite to run code analysis, which are;
    1. SonarQube must be installed on local machine.
    2. SonarQube server should be Up and Running as localhost:9000
    3. SonarScanner for .NET must be configured.
    4. Visual Studio 2015 Update 3, VS2017, VS 2019 or VS 2022 must be installed in the system.
    5. Little Knowledge about Command Line (optional).
    ________________________________________________________________
    If you have all above things ready, go to the next step which is 'How to run code analysis for ASP.NET/C#/VB.NET project'. Otherwise watch my video on that how to install, configure and setup the SonarQube server on local machine. A complete video for beginner as well as expert who want to setup the SonarQube server on local machine/server.
    ________________________________________________________________
    Here is the Video link for How to install, configure and setup SonarQube for Windows 10.
    ➤ • Step-by-Step Tutorial:...
    Also like and share the channel if the content benefits you and don't forget to tell about the improvements in comments.
    ____________________________/SOCIAL LINKS\__________________________________
    FACEBOOK PAGE ➤ / easylearningchannel
    LINKEDIN ➤ / tahirazeemalvi
    GITHUB ➤ github.com/tahiralvi
    STACKOVERFLOW ➤stackexchange.com/users/14540...
    ___________________________________________________________________________
    #SonarQube #AspNet #SonarScanner #CodeAnalysis #codequality
    00:00 SonarQube: How to analyze ASP.NET/C#/VB.NET project
    5:25 Run the command 1 with SonarQube Scanner for .NET - Analyze
    7:38 Run the command 2 with SonarQube Scanner for .NET - Build
    9:48 Run the command 3 with SonarQube Scanner for .NET - Generate Report
    11:28 Browse through the code analysis report in SonarQube
    12:28 How to effectively use SonarQube static code analysis report

ความคิดเห็น • 37

  • @ColoqueNombreAqui
    @ColoqueNombreAqui 2 ปีที่แล้ว +4

    Thank you very much, I had some issues with the paths in order to use correctly this tool, I searched in many sites and vids but no one explained what I needed until I found your video. You are the best man, keep it going with your great job 🤗

    • @TahirAlviOfficial
      @TahirAlviOfficial  2 ปีที่แล้ว +1

      Thanks for like the video. This is great if you find the video useful and helps you. Stay Cool

  • @umaralvi3327
    @umaralvi3327 2 ปีที่แล้ว +1

    Sound perfect. Thanks for sharing such a great video. The way you explain things is awesome.

  • @sudiptosarker6274
    @sudiptosarker6274 ปีที่แล้ว +2

    Thank you. very helpful.

  • @bhanuprakashsingh5513
    @bhanuprakashsingh5513 2 ปีที่แล้ว +1

    Thanks for this demo it will very use full........

  • @umaralvi3327
    @umaralvi3327 2 ปีที่แล้ว +1

    Great

  • @mounioru6622
    @mounioru6622 ปีที่แล้ว +1

    Thanks a lot!

  • @uzairali4768
    @uzairali4768 2 ปีที่แล้ว +1

    Informative. Thank you sir Thair

  • @umaralvi3327
    @umaralvi3327 2 ปีที่แล้ว +1

    Very good and

  • @hardikpatel5014
    @hardikpatel5014 2 ปีที่แล้ว +1

    It's a great tutorial, loved the way it explained.
    Issue: I did all the steps correctly but getting "The main branch of this project is empty." and no files are there. does anyone come across with such issue.

    • @TahirAlviOfficial
      @TahirAlviOfficial  2 ปีที่แล้ว

      Firstly, Thank you for like the video.
      Secondly, please make sure you run the SonarQube commands from the folder/project which is set as a default project.

  • @fanzfanzilla
    @fanzfanzilla ปีที่แล้ว +1

    Thank you for the video. I followed your instructions for couple of my projects. For project1, I got stuck at step 2. The msbuild did not like the solution (sln) file. So I gave up. For the 2nd project I got stuck on step 3 to run the command for "End". I get this error: The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    I have no idea how to get pass these errors. Both of my projects are ASP.Net 4.8 and build as a website. Any recommendations are much appreciated.

    • @TahirAlviOfficial
      @TahirAlviOfficial  ปีที่แล้ว

      Have you verify the jdk version, it should not be the latest.

  • @tracyquick5768
    @tracyquick5768 2 ปีที่แล้ว +1

    Amazing video. Can you help me understand why coverage % is displayed as zero in your sonarqube report?

    • @TahirAlviOfficial
      @TahirAlviOfficial  2 ปีที่แล้ว

      For Calculate the coverage, need to install plugin like Jacoco's and configure it for project or for server.

    • @tracyquick5768
      @tracyquick5768 2 ปีที่แล้ว +1

      @@TahirAlviOfficial ; Thanks so much for quick response. I am doing code analysis for a .NET application. Please suggest how can fix code coverage appearing as 0%.

    • @TahirAlviOfficial
      @TahirAlviOfficial  2 ปีที่แล้ว

      When you write the command which is generated by Sonarqube for you. Between the begin and end statement, you need to build your project, execute test results and generate code coverage data.

  • @dgroh
    @dgroh 2 ปีที่แล้ว +1

    Thanks for your video and sharing your knowledge. Why should your code pass with 1.3k Code Smells? That is silly. I'm having the same issue and still didn't figure out how to make it not pass.

    • @TahirAlviOfficial
      @TahirAlviOfficial  2 ปีที่แล้ว

      All code smells are from the 3rd party libraries or from Plugin code. Either you should completely ignore or skip it from being analysis.

    • @TahirAlviOfficial
      @TahirAlviOfficial  2 ปีที่แล้ว

      Another point is that when you run Code analysis for the first time, Sonarqube pass your code with whatever code smells. When you run 2nd time it will gave you the true or actual result and ultimately fail you code.

  • @user-en5qb2zi5i
    @user-en5qb2zi5i 29 วันที่ผ่านมา +1

    when I run command2,I will get the error " CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException",I don't know why,this is my path “C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\”MsBuild.exe /t:Rebuild

    • @TahirAlviOfficial
      @TahirAlviOfficial  23 วันที่ผ่านมา

      Thanks for reaching out, are you able to build your project successfully or still facing the errror.

    • @user-en5qb2zi5i
      @user-en5qb2zi5i 23 วันที่ผ่านมา +1

      @@TahirAlviOfficial I will go to check,thanks for your help

  • @mdabutalha6876
    @mdabutalha6876 2 ปีที่แล้ว +1

    interest

  • @vskvicky7212
    @vskvicky7212 ปีที่แล้ว +1

    When i m running the second command it is saying enalble parallel build and build failed

    • @TahirAlviOfficial
      @TahirAlviOfficial  ปีที่แล้ว

      first you need to verify that Sonarqube installation is properly configured. because I am not aware of this error.

  • @rehanbhombal
    @rehanbhombal ปีที่แล้ว +1

    Where can i get this STSWeb Demo code?

    • @TahirAlviOfficial
      @TahirAlviOfficial  ปีที่แล้ว

      Hi, you don't needs to get the same project. It's for example purposes. Either create your own test project or get any existing one from github or online. the idea is to how to analyzing the code.

    • @rehanbhombal
      @rehanbhombal ปีที่แล้ว +1

      @@TahirAlviOfficial Thanks for replying, I need to demonstrate the tool to a client so for that i require sample code which will bring out all type of errors , not able to find such a sample in github.

    • @TahirAlviOfficial
      @TahirAlviOfficial  ปีที่แล้ว

      you could search for teamtreehouse library, there you can find some templates working projects.

    • @TahirAlviOfficial
      @TahirAlviOfficial  ปีที่แล้ว

      or search example-aspnet-mvc on github.

    • @rehanbhombal
      @rehanbhombal ปีที่แล้ว

      @@TahirAlviOfficial Thank you, i will try that. Appreciate it.