![]() A good time to discuss this is the code review process. Sometimes SonarQube and SonarLint will show errors or issues that are not really a problem. We can use this to guide our discussions about what to prioritize as we work towards improved test coverage and quality. 3) Periodically Triage: The teams map pull up Sonar periodically to look at our most common issues and to look at broader trends in test coverage. Bring up issues in the Fisheye review process. Also look at test coverage to consider whether the new code has enough tests. ![]() 2) During Reviews: Open Sonar to look at errors and issues in the code during a review. We want to clean up code as we touch it (fix as we go). There are three main use cases for Sonar that we are encouraging during the OpenLMIS v3 development:ġ) SonarLint plug-in in IntelliJ. Each one connects that IntelliJ project to the matching project in SonarQube. The Project Settings are made per IntelliJ project, so you will need to open each OpenLMIS project you are working on and set the project settings for each one.That's it! Now you can use the SonarLint feature inside IntelliJ to get immediate feedback.Then select the project that corresponds to whichever project you have open in IntelliJ. Set the SonarLint Project Settings: Click "Enable binding.", then select the OpenLMIS server you added in the previous step.Use the "Test Connection" button to make sure your IntelliJ can connect to the OpenLMIS Sonar. You do not need to change the default Authentication type and you do not need to enter a Token (leave the Token field empty). ![]() Click the "+" button and fill in the dialog box that appears: The Server URL is "". You will need to add the connection to the OpenLMIS SonarQube server. You may need to re-launch IntelliJ for the new plug-in to become active. Select the plug-in zip file you downloaded.In IntelliJ, open Settings (called Preferences on Mac), then go to Plug-ins and click "Install plug-in from disk":.Keep it zipped (you do not need to unzip it). Download SonarLint plug-in from the SonarLint IntelliJ plug-in site.Launch IntelliJ and open an OpenLMIS project.Prerequisite: You must already have IntelliJ IDEA installed and have an OpenLMIS project open. Wow! Look at that immediate feedback! How to Install SonarLint It runs an immediate analysis as you change code, and by 'binding' your plug-in with the OpenLMIS SonarQube server, it uses the same set of rules and checks. The SonarLint IntelliJ plug-in allows you to see an easy report about code issues right inside IntelliJ. Of course, there shouldn't be bugs in our new code, because any developer can see them right away using the SonarLint IntellIJ plug-in. The Test Coverage also displays orange stripes if some, but not all, of the conditions in branching logic are covered by tests:ĭuplicated Code is specifically identified by line and file, even across projects (across repos):Ĭlick on the red arrows to see details about any issue/bug: Use this during code reviews to see if there are bugs in the code we are reviewing.Ĭode view indicates test coverage with color-coded green and red stripes. Project code viewĬlicking on "Code" from any project view lets you drill in by folder to see any file of code. You can also catch these same issues in real time while code is written in IntelliJ using SonarLint (see below). It is based on the Sonar philosophy of Fixing the Water Leak.Ĭlicking any of the links (on the bug count, code small count, etc) takes you to a specific list of the bugs/issues and shows where they happen in the source code. ![]() We can focus on fixing the issues as we introduce them. That allows us to focus on what has gotten worse or better most recently, like over the course of a sprint. The 'Leak Period' shows how these statistics have changed in the last period, currently set to 14 days. this one for the OpenLMIS v3 Fulfillment service) show specific metrics and trends: It allows you to click to drill in to find coverage gaps. The homepage also has a 'tree map' showing color-coded unit test coverage statistics. The project links take you to the project overview showing specific issues tracked over time for that project (see below). Start at the OpenLMIS SonarQube homepage: In addition, Sonar also tracks test coverage and complexity, thereby serving as a tool to look broadly at code quality. OpenLMIS has its own SonarQube server and recommends that developers use the SonarLint IntelliJ plug-in as a comprehensive way to track and improve code quality over time. The Sonar configuration is aligned with the OpenLMIS OpenLMIS Coding Standards including the v3 Service Style Guide.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |