Tuesday 27 August 2019

Part - 2 Analyze code Using SonarQube



Part - 4 Integrate SonarQube with Visual Studio using SonarLint


  1. Login SonarQube user interface: http://localhost:9000/sessions/new
  2. Create a Project and given name like "TestCode" as see the screenshot and click on Set Up.


  3. Generate a Token, Click on Generate:


  4. Now See the Generated Token and click on continue:

  5. Select your project's main language as seen in the screenshot and click on Download:

    Note: If you are not downloaded MS Build Sonar Scanner than download and Add path in Environment Variable.








  6. Next, it will give you commands.

  7. Copy all commands and store in some location.
  8. Open the command prompt as administrator and go to project root and run the 1st command.
    SonarScanner.MSBuild.exe begin /k:"TestCode" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="fa711df938cea5515457fb505d693799a42ae936"

    and It will run on project root after the run will show “succeeded” message.



  9. Now Rebuild with MSBuild.exe from the project root.
    Before executing the 2nd command find the "MsBuild.exe" in your system, I am using vs2017 and my location is- "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MsBuild.exe"

    Execute the command
    "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MsBuild.exe" /t:Rebuild

    It will take some time and once done will show Total Time Elapsed as see the screenshot.





    Otherwise, you can add the msbuild.exe path in Environment Variable and execute 
    MsBuild.exe /t:Rebuild 




    It will take some time and once done will show Total Time Elapsed as see the screenshot.




  10. Once Rebuild done, it’s time to run the scanner.
    SonarScanner.MSBuild.exe end /d:sonar.login="fa711df938cea5515457fb505d693799a42ae936"




  11. Once all are done, then we can see the project with data in SonarQube instance with some quality reports.

    SonarQube Dashboard


    Project Overview


    Project Issues


    Project Issues Details





    Project Measures



    Project Code path








2 comments:

  1. Best web diary on the scanner I have ever seen. I am a businessman and for my work propose, I had to contract onsite3d so that I can check my wander. They did a bewildering work. They are in addition took a toll moo from their client. Get quality laser scanning Vancouver, BC

    ReplyDelete

Sitecore Publishing Service 7.0 Installation Guide

  About the Publishing Service module The Publishing Service module is an optional replacement for the existing Sitecore publishing methods....