SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
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 Review tools
• Static Analysis – PMD, Findbugs, Checkstyle
• Duplicate Code – (Squid, CPD)
• Code Coverage – (Cobertura, JaCoCo)

• Easy to integrate with Jenkins build
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
• 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
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
Assign it to someone
Assign it to an action plan
Unresolved issues in Project
What now
• What to Start With
• Check violations for your project
• Remove duplicate code
• Improve test coverage

Mais conteúdo relacionado

Semelhante a Training material sonar v1

Sumo Logic QuickStart - May 2016
Sumo Logic QuickStart - May 2016Sumo Logic QuickStart - May 2016
Sumo Logic QuickStart - May 2016Sumo Logic
 
Sumo Logic quickStart Webinar June 2016
Sumo Logic quickStart Webinar June 2016Sumo Logic quickStart Webinar June 2016
Sumo Logic quickStart Webinar June 2016Sumo Logic
 
Practical (J)Unit Testing (2009)
Practical (J)Unit Testing (2009)Practical (J)Unit Testing (2009)
Practical (J)Unit Testing (2009)Peter Kofler
 
Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016Sumo Logic
 
Sumo Logic Quickstart - Jan 2017
Sumo Logic Quickstart - Jan 2017Sumo Logic Quickstart - Jan 2017
Sumo Logic Quickstart - Jan 2017Sumo Logic
 
Sumo Logic Quickstart - Nv 2016
Sumo Logic Quickstart - Nv 2016Sumo Logic Quickstart - Nv 2016
Sumo Logic Quickstart - Nv 2016Sumo Logic
 
Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016Sumo Logic
 
Sumo Logic QuickStart Webinar - Dec 2016
Sumo Logic QuickStart Webinar - Dec 2016Sumo Logic QuickStart Webinar - Dec 2016
Sumo Logic QuickStart Webinar - Dec 2016Sumo Logic
 
Rocket Circus on Code Review
Rocket Circus on Code ReviewRocket Circus on Code Review
Rocket Circus on Code Reviewrocketcircus
 
Node.js Dublin Meetup April 2014
Node.js Dublin Meetup April 2014Node.js Dublin Meetup April 2014
Node.js Dublin Meetup April 2014Damian Beresford
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog Ramdas Mozhikunnath
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Denim Group
 
Model Based Test Validation and Oracles for Data Acquisition Systems
Model Based Test Validation and Oracles for Data Acquisition SystemsModel Based Test Validation and Oracles for Data Acquisition Systems
Model Based Test Validation and Oracles for Data Acquisition SystemsLionel Briand
 
sree profile
sree profilesree profile
sree profilesrihari p
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionMichael Jesse
 
Add observability to your django application - PyCon FR 2019
Add observability to your django application - PyCon FR 2019Add observability to your django application - PyCon FR 2019
Add observability to your django application - PyCon FR 2019Bleemeo
 
SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ? SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ? Geeks Anonymes
 
Is code review the solution?
Is code review the solution?Is code review the solution?
Is code review the solution?Tiago Mendo
 

Semelhante a Training material sonar v1 (20)

Sonarjenkins ajip
Sonarjenkins ajipSonarjenkins ajip
Sonarjenkins ajip
 
Sumo Logic QuickStart - May 2016
Sumo Logic QuickStart - May 2016Sumo Logic QuickStart - May 2016
Sumo Logic QuickStart - May 2016
 
Sumo Logic quickStart Webinar June 2016
Sumo Logic quickStart Webinar June 2016Sumo Logic quickStart Webinar June 2016
Sumo Logic quickStart Webinar June 2016
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
 
Practical (J)Unit Testing (2009)
Practical (J)Unit Testing (2009)Practical (J)Unit Testing (2009)
Practical (J)Unit Testing (2009)
 
Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016Sumo Logic Quick Start - Feb 2016
Sumo Logic Quick Start - Feb 2016
 
Sumo Logic Quickstart - Jan 2017
Sumo Logic Quickstart - Jan 2017Sumo Logic Quickstart - Jan 2017
Sumo Logic Quickstart - Jan 2017
 
Sumo Logic Quickstart - Nv 2016
Sumo Logic Quickstart - Nv 2016Sumo Logic Quickstart - Nv 2016
Sumo Logic Quickstart - Nv 2016
 
Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016Sumo Logic QuickStart Webinar July 2016
Sumo Logic QuickStart Webinar July 2016
 
Sumo Logic QuickStart Webinar - Dec 2016
Sumo Logic QuickStart Webinar - Dec 2016Sumo Logic QuickStart Webinar - Dec 2016
Sumo Logic QuickStart Webinar - Dec 2016
 
Rocket Circus on Code Review
Rocket Circus on Code ReviewRocket Circus on Code Review
Rocket Circus on Code Review
 
Node.js Dublin Meetup April 2014
Node.js Dublin Meetup April 2014Node.js Dublin Meetup April 2014
Node.js Dublin Meetup April 2014
 
SOC Verification using SystemVerilog
SOC Verification using SystemVerilog SOC Verification using SystemVerilog
SOC Verification using SystemVerilog
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
 
Model Based Test Validation and Oracles for Data Acquisition Systems
Model Based Test Validation and Oracles for Data Acquisition SystemsModel Based Test Validation and Oracles for Data Acquisition Systems
Model Based Test Validation and Oracles for Data Acquisition Systems
 
sree profile
sree profilesree profile
sree profile
 
SonarQube: Continuous Code Inspection
SonarQube: Continuous Code InspectionSonarQube: Continuous Code Inspection
SonarQube: Continuous Code Inspection
 
Add observability to your django application - PyCon FR 2019
Add observability to your django application - PyCon FR 2019Add observability to your django application - PyCon FR 2019
Add observability to your django application - PyCon FR 2019
 
SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ? SonarQube - Should I Stay or Should I Go ?
SonarQube - Should I Stay or Should I Go ?
 
Is code review the solution?
Is code review the solution?Is code review the solution?
Is code review the solution?
 

Mais de Shinu Suresh

Hybris 6.0.0 to 6.3.0 comparision
Hybris 6.0.0 to 6.3.0 comparisionHybris 6.0.0 to 6.3.0 comparision
Hybris 6.0.0 to 6.3.0 comparisionShinu Suresh
 
Continuous Integrations & Deployments
Continuous Integrations & DeploymentsContinuous Integrations & Deployments
Continuous Integrations & DeploymentsShinu Suresh
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabShinu Suresh
 
Websphere Commerce SEO
Websphere Commerce SEOWebsphere Commerce SEO
Websphere Commerce SEOShinu Suresh
 
Training material exceptions v1
Training material   exceptions v1Training material   exceptions v1
Training material exceptions v1Shinu Suresh
 

Mais de Shinu Suresh (6)

Hybris 6.0.0 to 6.3.0 comparision
Hybris 6.0.0 to 6.3.0 comparisionHybris 6.0.0 to 6.3.0 comparision
Hybris 6.0.0 to 6.3.0 comparision
 
Git
GitGit
Git
 
Continuous Integrations & Deployments
Continuous Integrations & DeploymentsContinuous Integrations & Deployments
Continuous Integrations & Deployments
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
 
Websphere Commerce SEO
Websphere Commerce SEOWebsphere Commerce SEO
Websphere Commerce SEO
 
Training material exceptions v1
Training material   exceptions v1Training material   exceptions v1
Training material exceptions v1
 

Último

Rendezvous Arts on Chicago Tribune March20 2024
Rendezvous Arts on Chicago Tribune March20 2024Rendezvous Arts on Chicago Tribune March20 2024
Rendezvous Arts on Chicago Tribune March20 2024danwonclarinet
 
Recycle Ann Arbor Brand Guide Presentation
Recycle Ann Arbor Brand Guide PresentationRecycle Ann Arbor Brand Guide Presentation
Recycle Ann Arbor Brand Guide Presentationmakaiodm
 
THE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptx
THE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptxTHE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptx
THE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptxjoshualallenvargas
 
Digital Marketing Creative Portfolio - Xandra Somera
Digital Marketing Creative Portfolio - Xandra SomeraDigital Marketing Creative Portfolio - Xandra Somera
Digital Marketing Creative Portfolio - Xandra SomeraXandra26
 
Organization Presentation COMM 1100.pptx
Organization Presentation COMM 1100.pptxOrganization Presentation COMM 1100.pptx
Organization Presentation COMM 1100.pptxkd17240
 
Otto - a small story about the time after my brother passed away
Otto - a small story about the time after my brother passed awayOtto - a small story about the time after my brother passed away
Otto - a small story about the time after my brother passed awayberkumpje1
 
The Beach - a short visual story by Petra van Berkum
The Beach - a short visual story by Petra van BerkumThe Beach - a short visual story by Petra van Berkum
The Beach - a short visual story by Petra van Berkumberkumpje1
 
Bunavestire (33) The Annunciation in Art
Bunavestire (33) The Annunciation in ArtBunavestire (33) The Annunciation in Art
Bunavestire (33) The Annunciation in Artsandamichaela *
 
Man Rayed - Messing with the Mess Master
Man Rayed - Messing with the Mess MasterMan Rayed - Messing with the Mess Master
Man Rayed - Messing with the Mess MasterProfessorNordell
 
Fishy - a short comic by Petra van Berkum
Fishy - a short comic by Petra van BerkumFishy - a short comic by Petra van Berkum
Fishy - a short comic by Petra van Berkumberkumpje1
 
April LinkedIn Newsletter Image Slideshow.pdf TESTING #3
April LinkedIn Newsletter Image Slideshow.pdf TESTING #3April LinkedIn Newsletter Image Slideshow.pdf TESTING #3
April LinkedIn Newsletter Image Slideshow.pdf TESTING #3marissa753990
 
Flowering lilacs for celebrate spring 17
Flowering lilacs for celebrate spring 17Flowering lilacs for celebrate spring 17
Flowering lilacs for celebrate spring 17sandamichaela *
 
Ghostectives Storyboard (Work in Progress)
Ghostectives Storyboard (Work in Progress)Ghostectives Storyboard (Work in Progress)
Ghostectives Storyboard (Work in Progress)RyanLovett5
 
Film Poster for a fictional movie La Mer
Film Poster for a fictional movie La MerFilm Poster for a fictional movie La Mer
Film Poster for a fictional movie La MerAnna Barto
 
Miss Illusion- beginning boards yayyyyyy
Miss Illusion- beginning boards yayyyyyyMiss Illusion- beginning boards yayyyyyy
Miss Illusion- beginning boards yayyyyyycwang48
 
Schaduw - a short story by Petra van Berkum
Schaduw - a short story by Petra van BerkumSchaduw - a short story by Petra van Berkum
Schaduw - a short story by Petra van Berkumberkumpje1
 
its a wip forever because i said so yeuh
its a wip forever because i said so yeuhits a wip forever because i said so yeuh
its a wip forever because i said so yeuhangelicafronda7
 
The Art of Rain_The beauty of rain in paintings..ppsx
The Art of Rain_The beauty of rain in paintings..ppsxThe Art of Rain_The beauty of rain in paintings..ppsx
The Art of Rain_The beauty of rain in paintings..ppsxguimera
 

Último (20)

Rendezvous Arts on Chicago Tribune March20 2024
Rendezvous Arts on Chicago Tribune March20 2024Rendezvous Arts on Chicago Tribune March20 2024
Rendezvous Arts on Chicago Tribune March20 2024
 
Recycle Ann Arbor Brand Guide Presentation
Recycle Ann Arbor Brand Guide PresentationRecycle Ann Arbor Brand Guide Presentation
Recycle Ann Arbor Brand Guide Presentation
 
THE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptx
THE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptxTHE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptx
THE-GLOBAL-INTERSTATE-SYSTEM contemporary.pptx
 
Digital Marketing Creative Portfolio - Xandra Somera
Digital Marketing Creative Portfolio - Xandra SomeraDigital Marketing Creative Portfolio - Xandra Somera
Digital Marketing Creative Portfolio - Xandra Somera
 
Organization Presentation COMM 1100.pptx
Organization Presentation COMM 1100.pptxOrganization Presentation COMM 1100.pptx
Organization Presentation COMM 1100.pptx
 
Otto - a small story about the time after my brother passed away
Otto - a small story about the time after my brother passed awayOtto - a small story about the time after my brother passed away
Otto - a small story about the time after my brother passed away
 
The Beach - a short visual story by Petra van Berkum
The Beach - a short visual story by Petra van BerkumThe Beach - a short visual story by Petra van Berkum
The Beach - a short visual story by Petra van Berkum
 
Bunavestire (33) The Annunciation in Art
Bunavestire (33) The Annunciation in ArtBunavestire (33) The Annunciation in Art
Bunavestire (33) The Annunciation in Art
 
Man Rayed - Messing with the Mess Master
Man Rayed - Messing with the Mess MasterMan Rayed - Messing with the Mess Master
Man Rayed - Messing with the Mess Master
 
Portfolio
PortfolioPortfolio
Portfolio
 
Fishy - a short comic by Petra van Berkum
Fishy - a short comic by Petra van BerkumFishy - a short comic by Petra van Berkum
Fishy - a short comic by Petra van Berkum
 
April LinkedIn Newsletter Image Slideshow.pdf TESTING #3
April LinkedIn Newsletter Image Slideshow.pdf TESTING #3April LinkedIn Newsletter Image Slideshow.pdf TESTING #3
April LinkedIn Newsletter Image Slideshow.pdf TESTING #3
 
Flowering lilacs for celebrate spring 17
Flowering lilacs for celebrate spring 17Flowering lilacs for celebrate spring 17
Flowering lilacs for celebrate spring 17
 
Ghostectives Storyboard (Work in Progress)
Ghostectives Storyboard (Work in Progress)Ghostectives Storyboard (Work in Progress)
Ghostectives Storyboard (Work in Progress)
 
Film Poster for a fictional movie La Mer
Film Poster for a fictional movie La MerFilm Poster for a fictional movie La Mer
Film Poster for a fictional movie La Mer
 
Miss Illusion- beginning boards yayyyyyy
Miss Illusion- beginning boards yayyyyyyMiss Illusion- beginning boards yayyyyyy
Miss Illusion- beginning boards yayyyyyy
 
Schaduw - a short story by Petra van Berkum
Schaduw - a short story by Petra van BerkumSchaduw - a short story by Petra van Berkum
Schaduw - a short story by Petra van Berkum
 
its a wip forever because i said so yeuh
its a wip forever because i said so yeuhits a wip forever because i said so yeuh
its a wip forever because i said so yeuh
 
The Art of Rain_The beauty of rain in paintings..ppsx
The Art of Rain_The beauty of rain in paintings..ppsxThe Art of Rain_The beauty of rain in paintings..ppsx
The Art of Rain_The beauty of rain in paintings..ppsx
 
Shadow Creation Service | CPH Graphics Media
Shadow Creation Service | CPH Graphics MediaShadow Creation Service | CPH Graphics Media
Shadow Creation Service | CPH Graphics Media
 

Training material sonar v1

Notas do Editor

  1. Blocker = number of PMD blocker issuesCritical = number of PMD critical issuesMajor = number of PMD major issuesMinor = number of PMD minor issuesInfo = number of PMD info issues
  2. Blocker = number of PMD blocker issuesCritical = number of PMD critical issuesMajor = number of PMD major issuesMinor = number of PMD minor issuesInfo = number of PMD info issues
  3. Blocker = number of PMD blocker issuesCritical = number of PMD critical issuesMajor = number of PMD major issuesMinor = number of PMD minor issuesInfo = number of PMD info issuesCyclomatic ComplexityThe Cyclomatic Complexity is measured by the number of (&&, ||) operators and (if, while, do, for, ?:, catch, switch, case, return, throw) statements in the body of a class plus one for each constructor, method (but not getter/setter), static initializer, or instance initializer in the class. The last return stament in method, if exists, is not taken into account.Even when the Cyclomatic Complexity of a class is very high, this complexity might be well distributed among all methods. Nevertheless, most of the time, a very complex class is a class which breaks the Single Responsibility Principle and which should be re-factored to be split in several classes.
  4. Blocker = number of PMD blocker issuesCritical = number of PMD critical issuesMajor = number of PMD major issuesMinor = number of PMD minor issuesInfo = number of PMD info issues
  5. Blocker = number of PMD blocker issuesCritical = number of PMD critical issuesMajor = number of PMD major issuesMinor = number of PMD minor issuesInfo = number of PMD info issues