Sonar

23
SONAR BY PRABAKARAN.J

description

SONAR, PMD Code review

Transcript of Sonar

Page 1: Sonar

SONAR

BY PRABAKARAN.J

Page 2: Sonar

SONAR is an open source quality management platform, dedicated

to continuously analyze and measure source code quality, from the portfolio to the method. As such, it covers the 7 axes of code quality.

Architecture and Design

Duplications

Unit tests

Comments

Coding Rules

Potential bugs Complexity

Sources

Page 3: Sonar

Sonar has got a very efficient way of navigating, a balance between high-level view, dashboard, Time Machine and defect hunting tools. This enables to quickly uncover projects and / or components that are in Technical Debt to establish action plans.

Portfolio view

Project insight

Source code

Action Plans

Hunting Tool Box

Page 4: Sonar

Extend with plugins:

Covering new languages, adding rules engines, computing advanced metrics can be done through a powerful extension mechanism. More than 50 plugins are already available.

Quality is central:

Sonar is a web-based application. Rules, alerts, thresholds, exclusions, settings can be configured online. By leveraging its database, Sonar not only allows to combine metrics altogether but also to mix them with historical measures.

Languages covered:

Java is built in. Open Source and commercial plugins enable to cover C, C#, Flex, Natural, PHP, PL/SQL, Cobol and Visual Basic 6.

Page 6: Sonar

Installation and Configuration

Prerequisite:

The only prerequisite to run Sonar is to have Java (Oracle JDK 1.5 onwards) installed on your machine.

Hardware Requirements:

1.The Sonar web server requires at least 500Mb of RAM to run efficiently.

2.In terms of data space and as an indication, on Nemo the public instance of Sonar, 10 Go of data space are used to analyze more than 13 millions Lines of Code with a history of 4 years. Nemo is currently running on a Amazon EC2 small instance.

3.To get the full experience Sonar has to offer, you should enable Javascript in your browser.

Page 7: Sonar

Sonar is made of 3 components:

1.A Database that stores the configuration and results of quality analysis

2.A Web Server that is used to navigate the results of the analyzes and make configuration

3.A Client that will run source code analyzers to compute data on projects

Page 8: Sonar

Installing Sonar Server

Prior to the installation, check the requirements.Download and unzip the distribution. sonar-3.2.zip from http://www.sonarsource.org/downloads/

Page 9: Sonar

Start the SONAR based on your OS go to \bin\windows-x86-32

Page 10: Sonar

Launch the sonar to browserhttp://hostaddress:9000

Page 11: Sonar

For login

User:admin Password:admin

Page 12: Sonar

Installing and Configuring Ant Task

Page 13: Sonar

Features:The Sonar Ant Task allows to integrate Sonar into a build script for Apache Ant to analyze a project with Sonar.

Prerequisites:•Ant 1.7.1 or higher•Java 1.5 or higher

Scope of Analysis:Sonar has capability to perform analysis on 15+ languages.The outcome of this analysis is going to be mainly measures of metrics and violations of coding rules. However, what gets analyzed by Sonar will vary depending on the language analyzed:

•On all languages, Sonar performs static analysis of source code (java files, Cobol programs, etc.)

•Sonar can perform static analysis of compiled code on certain languages (.class files or jars in Java, dll files in C#, etc.)

•Sonar can perform dynamic analysis of code on certain languages (execution of unit tests in Java, C#, etc.)

Page 14: Sonar

Projects List:

Page 15: Sonar

Project Dashboard:

Page 16: Sonar

Hotspots:

Page 17: Sonar

Reviews:

Page 18: Sonar

Time Machine:

Page 19: Sonar

Components :

Page 20: Sonar

Violations Drilldown:

Page 21: Sonar

Clouds:

Page 22: Sonar

Libraries: