Static Code Analysis using Sonar


Published on

Sonar is a static code analysis tool that covers the following aspects of code quality:
Architecture & design
Code comments
Coding rules mainly using Checkstyle
Potential bugs
Code complexity
Unit tests and code coverage
Code Duplications

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Static Code Analysis using Sonar

  1. 1. Static Code Analysis Using Sonar
  2. 2. About Neev Web Mobile Magento eCommerce SaaS Applications Video Streaming Portals Rich Internet Apps Custom Development iPhone Android Windows Phone 7 HTML5 Apps Cloud AWS Consulting Partner Rackspace Joyent Heroku Google App Engine Key Company Highlights 250+ team with experience in managing offshore, distributed development. Neev Technologies established in Jan ’05 VC Funding in 2009 By Basil Partners User Interface Design and User Experience Design Part of Publicis Groupe Member of NASSCOM. Performance Consulting Practices Development Centers in Bangalore and Pune. Quality Assurance & Testing Outsourced Product Development Offices at Bangalore, USA, Delhi, Pune, Singapore and Stockholm.
  3. 3. What Sonar does for you Sonar is a static code analysis tool that covers the following aspects of code quality: 1. Architecture & design 2. Code comments 3. Coding rules mainly using Checkstyle 4. Potential bugs 5. Code complexity 6. Unit tests and code coverage 7. Code Duplications
  4. 4. Download, Install and Run Sonar • Download and install latest version of Java if not already there • Download the latest version of Sonar here : • Unzip the package to a folder • Go to Sonar installation directory’s bin folder • Based on user platform and architecture, go to the corresponding directory under bin and run start (for Unix ) or StartSonar.bat start (for windows ) • For windows, there are also scripts to make Sonar as a Windows service • Once Sonar is started, it will be accessible at this URL http://localhost:9000 • For remote access, replace localhost with the address of the sonar server • 9000 is the default port and can be changed from conf/
  5. 5. Project Analysis using Sonar • Until recently it was only possible to use Maven along with Sonar. • From Sonar 2.6 an ANT Task is available to use Sonar in ANT-based projects. • Below are the steps to use Sonar from ANT: 1. Download the Sonar ANT Task and copy it in your ANT_HOME/lib directory 2. Open your project’s build.xml and add xml code to it 3. Once this is done, run ant sonar 4. This will run Sonar on your code and push the metrics to the Sonar Server. Once the ant task is complete, launch the Sonar Server (http://localhost:9000 or whatever) and view the reports. • Relevant code is on page
  6. 6. Configuring and Customizing Sonar • Sonar can be configured to suit your needs by changing settings in conf/ file. • Things that may typically need change are : 1. Port, IP at which Sonar should run 2. Database settings to make Sonar run on a database MySQL, Postgres, etc. instead of the default Derby database like • Sonar has some interesting plugins to enhance the features of Sonar and to facilitate analysis of code written in languages other than Java. • The complete list of plugins is available below:
  7. 7. Want to Know More About Sonar ? To know more visit the link below : To read the blog please visit the link below :
  8. 8. Clients
  9. 9. Partnerships
  10. 10. Neev Information Technologies Pvt. Ltd. India - Bangalore India - Pune The Estate, # 121,6th Floor, #13 L’Square, 3rd Floor Dickenson Road Parihar Chowk, Aundh, Bangalore-560042 Pune – 411007. Phone :+91 80 25594416 Phone : +91-64103338 USA Sweden Singapore Neev AB, Birger Jarlsgatan 1121 Boyce Rd Ste 1400, Pittsburgh PA 15241 Phone : +1 888-979-7860 #08-03 SGX Centre 2, 4 53, 6tr, Shenton Way, 11145, Stockholm Singapore 068807 Phone: +46723250723 Phone: +65 6435 1961 For more info on our offerings, visit