Android Code checker tool Sonarqube

Source: Internet
Author: User
Tags apache tomcat continuous integration tools


The Code checker can help us check for some hidden bugs, and sonar is the better one in the Code checker tool. Website


Sonar Overview


Sonar is an open platform for code quality management. Through the plug-in mechanism, Sonar can integrate different test tools, code analysis tools, and continuous integration tools. Unlike continuous integration tools (such as hudson/jenkins, etc.), Sonar does not simply display different code-checking tool results (such as FINDBUGS,PMD, etc.) directly on the Web page, but instead uses different plug-ins to process the results. Measure code quality changes in a quantifiable way, making it easy to code quality management for projects of different sizes and types.
in support of other tools, sonar not only provides support for the IDE, it can view the results online in the tools of Eclipse and IntelliJ idea, while sonar also provides interface support for a large number of continuous integration tools that can be easily Use Sonar in integration.
In addition, Sonar's plug-in provides support for programming languages other than Java, as well as internationalization and reporting documentation.
Key Features
• Code Coverage: Passing unit tests will show which line of code is selected
• Improve coding rules
• Search for coding rules: query by name, plugin, activation level and category
• Project Search: Search by project name
• Compare data: Compare the trend of any measurement in the same table


Installation of Sonar


Sonar is an open source project above Codehaus, using the LGPL V3 software license. We can download its source code and installation package on its official website. Its source code needs to use the Distributed version control software Git for checkout (check out), the command line is as follows:
git clone git://github.com/sonarsource/sonar.git
This article mainly describes the use of Sonar and the Android studio plug-in installation method, just to Sonar website downloads the latest release package, the most recent version of this article is 4.5.1, after downloading the zip package, unzip directly to any directory, because Sonar comes with a Jetty 6 application server environment, so there is no need for additional installation can be used, it is worth mentioning that Sonar also supports deployment in Apache Tomcat application servers. In a Windows environment, start SOANR directly under Windows-x86-64\startsonar.bat in the Bin directory. And then access in the browser: http://localhost:9000/(Chinese will need to download the additional Chinese package):



Documentation and some jar packages and plug-in installation click Run Analysis:



First sign in to the configuration item:


The default is: Admin,admin.

After login



Click Provisioning, click Create, enter the keyword and project name (preferably the same as the project name of the check code):



Other settings are not required and can be skipped.

If it is cumbersome and not easy to use without the integration plug-in, the following is described below in Android studio to install using the sonar plugin (IntelliJ idea similar).



Click Install and reboot to install.

Let's say the following configuration:



After installation, click the Sonarqube option, add a server, enter the default address and username password, test the connection, OK.

Right-click the project associated with the background server project:



Enter the project name for the configuration, OK:



Right-click analyze--"Inspect code, the console will see the results."




Analysis results:


If you have any questions, please leave a message, reproduced the source.

Android Code checker tool Sonarqube

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.