track code quality with sonarqube

33
Track code quality with SonarQube

Upload: dmytro-patserkovskyi

Post on 14-Jan-2017

85 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Track code quality with SonarQube

Track code quality with SonarQube

Page 2: Track code quality with SonarQube

HELLO!I am Dmytro Patserkovskyi

Project Manager and Founder of Dev SonarQube Community at V.I.Tech

Taras Matyashovsky
Переніс би в наступний рядок, типу перший рядок Project Manager at V.I. Tech, наступний рядок Founder of ....
Dmytro Winged
Також хотів так написати, але комюніті обмежене в межах V.I.Tech, і дублювати назву компанії не хочеться.
Page 3: Track code quality with SonarQube

Low code quality costs a lot

Page 4: Track code quality with SonarQube

Toyota storyAug. 28, 2009, San Diego CA, USA

◉ Toyota reached 100 mph

◉ Phone call during event

◉ All 4 occupants killed in crash

◉ This is a trigger for Toyota investigation

Taras Matyashovsky
Якщо я використую десь картинки - то я в футері і в кінці презентухи пишу явно посилання де я то взяв. Як правило хорошого тону.
Page 5: Track code quality with SonarQube

Toyota story

NASA’s investigation found

7134 violations in code.

Oklahoma’s investigation found

81 514 violations in code.

Page 6: Track code quality with SonarQube

Toyota story: Results◉ Recall of 10 000 000+ cars entire the world.

◉ Lost of billions dollars.

◉ 89 death till 2010 because of bugs.

Page 7: Track code quality with SonarQube
Page 8: Track code quality with SonarQube

Source Code Should BeSimple

& Readable

Extendable

Testable& Covered with Tests

Flexible

Page 9: Track code quality with SonarQube

Code Metrics

Page 10: Track code quality with SonarQube

Rules ViolationsCode Stylechecks if code compliant with conventions

Vulnerabilitiessearch for bottlenecks with lacks of validations, security issues etc

Bugslooking for bugs and potential bugs

Performance checks if everything doing in the best way

100% - rules compliance

Page 11: Track code quality with SonarQube

Code Coverage

Line Coverage

Branch CoverageOverall Coverage

85% - min overall coverage

Page 12: Track code quality with SonarQube

Cyclomatic Complexity

10 - max compliant complexity50 - function unsupported

Page 13: Track code quality with SonarQube

DublicationsI SHALL

NOT DUPLICATE ANY CODE ANY CODE ANY CODE

!0% - perfect solution1% - keep buffer

Page 14: Track code quality with SonarQube

Documentation

Code tells you what is doing, documentation should tell why and how.

JavaDocs Block Comments

100% - public documented API15% - comments in code

Page 15: Track code quality with SonarQube

Technical Debt

Extra development work, that rises with not clear code.

Financial DEBT Time DEBT

Page 16: Track code quality with SonarQube

An open source platform for

Continuous Inspection

Page 17: Track code quality with SonarQube

20+ programming languages

50+ official plugins

Page 18: Track code quality with SonarQube

Quality Rules and Profiles

Code Smells Bugs Vulnerabilities

Quality Profile

Page 19: Track code quality with SonarQube

Rules Plugins and Repositories

44

53

357

43

73

Page 20: Track code quality with SonarQube

Quality GatesSet of boolean conditions per project,

based on measure thresholds.

Passed

Warning

Failed

Page 21: Track code quality with SonarQube

Quality GatesMetric Operator

Open Issues Is greater than 70 100

Blocker Issues Is greater than 0

Critical Issues Is greater than 0

New Issues Is greater than 0 10

Overall Coverage Is less than 85 80

Unit Test Failures Is greater than 0

Page 22: Track code quality with SonarQube

Quality of New Code

Tracking quality of code, added in current snapshot

Comparison measures for different versions

Good for long term projects

Page 23: Track code quality with SonarQube

Project DashboardIssues Coverage Complexity

Anything you wantAnother awesome widget

Duplications Documentation Useful Info

Page 24: Track code quality with SonarQube

Code Processes

PullRequest

Master branch

Nightly

Each update

Page 25: Track code quality with SonarQube

Support Team for SonarQube

Page 26: Track code quality with SonarQube

Administrator

Sonar support and monitoring

Sonar upgrade (new version every 2 months)

Plugins upgrade (new version every month)

Page 27: Track code quality with SonarQube

Dev Sonar Community

Working on Rules List

Updating Quality Profiles

Setting up Dashboards

Looking for new Plugins

Page 28: Track code quality with SonarQube

Project Teams

Update project analysis frequently

Monitoring Quality of own project

Defining project Quality Gate

Voice and discuss all concerns with Sonar Community

Page 29: Track code quality with SonarQube

Support Processes

ModificationsMonthly

MeetingsBiweekly

FeedbacksOn-demand

DiscussionsOn-demand

UpgradeMonthly

Page 30: Track code quality with SonarQube

24/7 monitoring and transparency

Page 31: Track code quality with SonarQube

Summary◉ Start from small: perform analysis

◉ Track code quality everyday

◉ Develop your own standard, or use existing

◉ Organize support process to make SonarQube alive

◉ Transparency 24/7, even for customers

Taras Matyashovsky
Можеш це пояснити? Важко сприймається
Page 32: Track code quality with SonarQube

Questions

Page 33: Track code quality with SonarQube

THANKS!Resources◉ http://sonarqube.org◉ http://docs.sonarqube.org/display/PLUG/Plugin+Library◉ https://analysis.apache.org/

Links◉ https://facebook.com/dmytro.wng◉ http://slideshare.net/DmytroPatserkovskyi

Taras Matyashovsky
Бракує перед чим якогось саммарі слайду чи щось таке. Типу outcomes, take aways