Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Training Material
Sonar
11th October 2013
By Shinu Suresh
Agenda
• Introduction
• Sonar Portal
• Statistics
• Navigation
• Violations
Introduction
• A platform to manage code quality
• Free, Open source, LGPL web based portal
• Aggregates will know Code Re...
Sonar Portal
Sonar Basic Statistics
Quality Index
• Derived based on 4 pillars
Quality Index = 10 - 4.5 * Coding - 2 * Complexity - 2 * Coverage - 1.5 * Style...
Size Metrics
• Lines of Code
• Classes
• Packages
• Methods
• Accessors
Complexity
• Cyclomatic Complexity
• Method
• Class
• File
Complexities over 10 will be flagged
Rules Compliance
• Issues
• Rules Compliance
• Issue Types
Duplications
• Analyses duplications with in
• Class File
• Project
• Multiple Projects
Navigation
Navigating to Issue Drill down
Navigating to Specific file
Violations
Violations - Examples
Violations – Examples Cont
Managing Violations
• For Each violation You Can
•
•
•
•
•

Comment
Change its severity
Declare it as a false-positive
Ass...
Unresolved issues in Project
What now
• What to Start With
• Check violations for your project
• Remove duplicate code
• Improve test coverage
Upcoming SlideShare
Loading in …5
×

Training material sonar v1

1,482 views

Published on

Presentation on Sonar

  • Be the first to comment

Training material sonar v1

  1. 1. Training Material Sonar 11th October 2013 By Shinu Suresh
  2. 2. Agenda • Introduction • Sonar Portal • Statistics • Navigation • Violations
  3. 3. Introduction • A platform to manage code quality • Free, Open source, LGPL web based portal • Aggregates will know Code Review tools • Static Analysis – PMD, Findbugs, Checkstyle • Duplicate Code – (Squid, CPD) • Code Coverage – (Cobertura, JaCoCo) • Easy to integrate with Jenkins build
  4. 4. Sonar Portal
  5. 5. Sonar Basic Statistics
  6. 6. Quality Index • Derived based on 4 pillars Quality Index = 10 - 4.5 * Coding - 2 * Complexity - 2 * Coverage - 1.5 * Style • Coding • Checks for PMD compliance. Rule applied is Coding = (Blocker * 10 + Critical * 5 + Major * 3 + Minor + Info) / (Lines of Code - Duplicated Lines) • Complexity • Checks for method complexities. Rule applied is Complexity = (Complexity>30 * 10 + Complexity>20 * 5 + Complexity>10 * 3 + Complexity>1) / (Lines of Code - Duplicated Lines) • Coverage • Coverage of Unit Tests • Style • Check style compliance index. Rule applied is Style = (Errors * 10 + Warnings) / (Lines of Code - Duplicated Lines) * 10
  7. 7. Size Metrics • Lines of Code • Classes • Packages • Methods • Accessors
  8. 8. Complexity • Cyclomatic Complexity • Method • Class • File Complexities over 10 will be flagged
  9. 9. Rules Compliance • Issues • Rules Compliance • Issue Types
  10. 10. Duplications • Analyses duplications with in • Class File • Project • Multiple Projects
  11. 11. Navigation
  12. 12. Navigating to Issue Drill down
  13. 13. Navigating to Specific file
  14. 14. Violations
  15. 15. Violations - Examples
  16. 16. Violations – Examples Cont
  17. 17. Managing Violations • For Each violation You Can • • • • • Comment Change its severity Declare it as a false-positive Assign it to someone Assign it to an action plan
  18. 18. Unresolved issues in Project
  19. 19. What now • What to Start With • Check violations for your project • Remove duplicate code • Improve test coverage

×