SonarQube analysis and SonarLint integration with Visual Studio 2019

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 2020
  • This video contains details on how to configure SonarQube on local system and perform the scan for local solution. It also contains details on how to integrate SonarLint with Visual Studio. I have also covered how to scan code coverage in visual studio for community/professional edition.

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

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

    Thank you for explaining the configurations and generating reports. This video is helpful.

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

    Hi, Nice tutorial. Thanks for posting it. I'm trying to understand what SQ is actually scanning. My understanding is that it's the embedded source code, which is what goes into the compiler, not what is generated by the compiler.

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

    Great Explanation,thanks for the Info

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

    Flawlessly descriptions...

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

    Thank you very much, nice explanation.

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

      Than you for the comment, if the content helps you do subscribe to my channel.

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

    I ran the sonar test-specific command. I had one test case, it passed but the coverage file didn't generate.

  • @lalitha722
    @lalitha722 3 ปีที่แล้ว +3

    Thank you so much for your great explanation. It was really good. I have a question, for test project configuration, you have configured opencover.xml file right, can we do the same via commands?

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Thank you for the comment.
      Below page contains the commands you can use for setting up the open cover reports path:
      docs.sonarqube.org/latest/analysis/coverage

    • @AbhishekGupta-hs8nh
      @AbhishekGupta-hs8nh ปีที่แล้ว

      ​@@thesoftwaredeveloper2307 Hi sir my unit test project does not show lines of code on sonarcube server what can be issue it also does not show code coverage for unit test project

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

    Thanks a lot for this information

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Thank you for the comment.
      if the content helps you, please like, share and subscribe to my channel.

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

    thank you for explanation 👍

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

    awesome. It worked like charm for me

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

      Thank you for the comment, glad it helped...
      Do subscribe to the channel..

    • @maniraj1920
      @maniraj1920 3 ปีที่แล้ว

      @@thesoftwaredeveloper2307 once changes are staged, the code coverage is 0%. I don't have admin access so "Project Setting" is hidden. How to counter part this?

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

      @@maniraj1920 In case you are not able to access the admin portal, you can pass the path of generated coverage report path while executing the first command related to setting up the project in SonarQube. Please refer below post on how to pass the coverage report path:
      community.sonarsource.com/t/coverage-test-data-generate-reports-for-c-vb-net/9871
      Do let me know in case its not working.

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

    Great!!!

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

    Thank you so much, how I can excludes some projects from code coverage, or exclude all projects and include one project for the testing.

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

      Sorry for delayed response, that can be done from project settings on sonar portal.
      Please refer below link for same -- docs.sonarqube.org/latest/project-administration/narrowing-the-focus/

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

    Very helpful

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Thanks for the comment, if the content helps you please do subscribe to my channel.

  • @naresh2423
    @naresh2423 11 หลายเดือนก่อน

    Bro you are awesome. I will connect with you

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

    Very good
    Chouksey mam

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

    Great Explanation, but where can i configure file exclusions(not on ui). if wanted to change in sonar-project.properties file and based on that i want my analysis scope defined

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

      Sorry for delayed response, I have not tried this approach but try something like this:
      sonar.exclusions=system/**, test/**
      Let me know if this works, I will also try from my end to see if this works.

  • @Manikandan-sr1sk
    @Manikandan-sr1sk ปีที่แล้ว

    Thanks for you video, I am trying to intergrate sonarQube with angular 12 application, Sonar detect any username and password but not detection any accesskey(api key) if hardcoded value, is there any way to write rules for this case...

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

    nicely explained.... can you make a video on Unit testing for web Api controllers.. it will be helpful. Thanks

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Thanks for the comment, I will plan for the unit testing topics shortly.

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

    @The Software Developer can u please suggest how to perform code analysis for the same by using jenkins freestyel job

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

    Thanks for this beautiful video. Do you have a github repo for this sample project that you can share. Will really appreciate to get a practical hands on. Thanks in advance

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

    When I run cmd I get error about sufficient rights to check license.
    dotnet sonarscanner begin /k:"Test_Scan_1"
    Generated an error:
    The token you provided doesn't have sufficient rights to check license.
    I should use:
    dotnet sonarscanner begin /k:"Test_Scan_1" /d:sonar.login=
    Token is generated from localhost:9000/account/security/
    About Java version is not working as well sometimes with latest version of jdk. At moment jdk-11 and jdk-13 is good but not jdk-15.0.2.

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Thanks for mentioning the solution related to token.
      I was also facing issues with jdk latest version so used previous one, forgot to mention that point in recording.

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

    Hi nice explaination, actually I wanted to fail build with sonar qube warning can please help me how to do it

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

    Thanks for the video, I am using SonarQube Community Version and Visual Code(with Angular, TypeScript and JavaScript). I run the commands and get the result in SonarQube. But I have two issues. 1) The Coverage is always shown as 0.0%..... 2) The Hotspots Reviewed sometimes shows E and A. .. Can you please help me as what need to done or configure to solve these two issues?

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

      Thanks for watching the video, I came across below article on integrating angular code coverage with sonarqube and similar steps I have followed in past:
      medium.com/@learning.bikash/angular-code-coverage-with-sonarqube-d2283442080b
      Let me know if you still face the issue.

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

      @@thesoftwaredeveloper2307 Thanks for the article. I have almost all the necesary set up. But still I am facing the same issues. Please your help. May be I need to some additional settings in sonarqube and my code in VS Code.?

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

      @@amiraliansari9887 Sorry for delayed response, I was in training for last week.
      Please confirm if below steps works for you, these are the steps I have followed in my project:
      First, we need to install sonar-scanner node package in the Angular application.
      Use below command to install this sonar-scanner package:
      npm install sonar-scanner - save-dev
      Once the package is installed, create file named “sonar-project.properties” in project root directory and add below configurations in it:
      sonar.host.url={IP}:9000/
      sonar.login=admin
      sonar.password=admin
      sonar.projectKey=text-phrase-client
      sonar.projectName=text-phrase-client
      sonar.projectVersion=1.0
      sonar.sourceEncoding=UTF-8
      sonar.sources=src
      sonar.exclusions=**/node_modules/**
      sonar.tests=src
      sonar.test.inclusions=**/*.spec.ts
      sonar.typescript.lcov.reportPaths=coverage/lcov.info
      Run below command in terminal to generate the code coverage file:
      ng test - watch=false - code-coverage
      New Folder named coverage will be created under project directory:
      First, we need to add below script entry in package.json file:
      "scripts": {
      "sonar": "sonar-scanner"
      }
      Once done, run below command to perform the sonar scan:
      npm run sonar

  • @AbhishekGupta-hs8nh
    @AbhishekGupta-hs8nh ปีที่แล้ว

    Hi sir my unit test project does not lines of code on sonarcube server what can be issue it also does not show code coverage for unit test project

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

    Nice tutorial. Could you please help me how to get the source code for this project? i mean ProfileInfo source code C#. Thanks

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

    What if sonarqube is maintanined by other team, how can I refresh the results in sonarqube? particulary the code coverage.

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Every time you run the commands successfully the sonarqube portal will be updated with latest coverage info.
      If you are running this in pipeline you will need to make sure you have service connection in place to communicate with sonarqube portal for uploading the scan results.

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

    Does code build mandatory step in sonarqube, as I am facing issue with build via command prompt. Although it is getting succesfull build in VS2019. I am also getting MSBUILD : error MSB1008: Only one project can be specified.
    Can you please help me with this?

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

      Sorry for the delayed response, based on what I have seen so far this issue comes if there is any space in arguments. Please verify if the arguments you are passing to the command are in correct format.

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

    hi.Will this worl for code written in c++.Not sure sonaqube is free for c++

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Thank you for the comment. C++ support is not available with community edition of sonarqube, for that you will need to go with developer edition which is paid.
      If the video helps you do share with others and subscribe to my channel to grow it further.

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

    i did not get coverage-opencover.xml file on unit test project 15:19 here

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

    SonarQube starts at 4:00

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

    Nice video but still got I keep getting an error when I start the server "Error: Could not find or load main class org.tanukisoftware.wrapper.WrapperSimpleApp" I've tried to download multiple versions of jdk's but all give the same results any idea's

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      This may happen if the path for JAVA folder is not correct in wrapper.conf file, please make sure you have updated the wrapper.conf file with new path for JDK e.g. C:\Program Files\java\jdk-13\bin\java
      Let me know if this works for you.

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

    Great explanation. Can you help me to set up SonarQube for React.js project. It would be a great help.

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      I have seen the steps to follow for setup in below blog:
      javascript.plainenglish.io/how-to-set-up-sonarqube-locally-on-a-react-typescript-project-ec02cd8e2626
      Try the steps, and if it still wont work let me know.
      If the content helps you do subscribe to my channel.

  • @sourabh-sahoo7553
    @sourabh-sahoo7553 3 ปีที่แล้ว +1

    Showing error in SonarCube that not passed parameter more than 7 ,How do I get resolve.

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      If possible please share more details, not sure if you are getting this error in between the scan or its displayed in final scan result.
      But SonarQube might show you this error in case your method depends on too many parameters, more than 7 parameters I think. You might need to fix the code to limit the number of parameters.

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

    how do u do from remote server?

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Sorry for delayed response, please refer below page for using remote server.
      docs.sonarqube.org/latest/analysis/analysis-parameters/
      You need to use sonar.host.url parameter while scanning the project.
      If the content helps you, do subscribe to the channel.

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

    thank you.where can I find source code

  • @dileepreddy9439
    @dileepreddy9439 3 ปีที่แล้ว

    I am getting Wrapper stopped
    omitted files
    Can you help me how to resolve above issues

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      Which version of Java you are using? It needs at least JAVA 11.. In case you are using OpenJDK then use below URL for downloading the latest version and then copy/paste the extracted JDK folder under java folder and then update the wrapper.conf file with new URL e.g. C:\Program Files\java\jdk-13\bin\java
      OpenJDK URL - jdk.java.net/archive/
      Let me know if this helps

    • @KrishnaReddy-tj4rn
      @KrishnaReddy-tj4rn 3 ปีที่แล้ว

      Hi @@thesoftwaredeveloper2307 i am facing the same issue i have added openjdk path has suggested but same result please can you help me

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      @@KrishnaReddy-tj4rn Thank you for the comment, please check few points -
      1. Before extracting the sonarqube zip file make sure you go to properties and unblock the file,
      2. Go to run and copy/paste the complete path you used for OpenJDK and hit enter, it should invoke the exe properly.
      3. One mistake I did while setting up for the first time, I forgot to remove '#' present before 'wrapper.java.command', make sure you remove the # sign.
      4. Make sure you always run bat file in admin mode
      Let me know if this solves the issue.
      I will also suggest you to go through SonarCloud tutorial for integrating sonar scan in azure pipeline- th-cam.com/video/rjLqULrhuXI/w-d-xo.html
      If you like the content do share with your colleagues and subscribe to my channel to grow it further.

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

    how to test php code using sonarqube can you make a video.

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      SonarQube has good documentation on how to achieve it - docs.sonarqube.org/latest/analysis/languages/php/
      You will need to install required plugin for same. Let me know if the documentation helps, if not I will try to do it from my end and will let you know the steps. Please do subscribe to my channel.

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

    How to generate a report in PDF format??

    • @thesoftwaredeveloper2307
      @thesoftwaredeveloper2307  3 ปีที่แล้ว

      As per my knowledge export to PDF option is only available with the Enterprise edition, the option is not available with the free version which I have used.

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

      It is possible to export the report in PDF with the bitegarden report plugin for SonarQube www.bitegarden.com/sonarqube-report

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

    Man - Your scanning command is incomplete

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

      Any issues you are facing?

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

      @@thesoftwaredeveloper2307
      The sequence of executing commands is like:
      Step 1: dotnet sonarscanner begin /k:"MyProject" /d:sonar.host.url="localhost:9000" /d:sonar.login="KEY"
      Step 2: dotnet build
      Step 3: dotnet sonarscanner end /d:sonar.login="KEY"
      KEY has to be configured from SONAR portal while creating a new project setup and SONAR is autogenerating this commands for us. Also the mention of default login credentials to SONAR is also reqruied.

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

      @@dhruval20 Thanks for pointing it out. As I was running all the setup locally that might be the reason I never needed to pass token, may be Force User Authentication setting was disabled so it worked fine but great that you have solution for that.
      For default credentials I have mentioned it at 14:22 I think, as user - admin and pass-admin.

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

      @@thesoftwaredeveloper2307 I am also trying on my local. And I also feels like it will be better to introduce the configuration of JDK. Latest version of JDK is not compatible with SONAR. It fails to start ES & JVM. Need to downgrade the JDK version and also need a configuration of JAVA_HOME