SlideShare a Scribd company logo
The automation of the process
of caring for the quality of the
code in PHP and JavaScript
… so how to avoid the following situation:
źródło: https://pbs.twimg.com/media/Bp1IyS7CYAATIEB.jpg
“Two words” about me
● A PHP programmer since 2007.
● CTO at Codesushi since 2013.
● A clean code preacher.
The plan, so what will this be about
● A bit of history, meaning the origins
of the discussed tools.
● An overview of standards and good
practices.
● An overview of tools supporting PHP.
● An overview of tools supporting Javascript.
● Taking advantage of tools in a local work environment.
● Taking advantage of tools in the continuous integration process.
Some history
● The spaghetti code era (~2006)
○ Mainly focused on the execution of projects and not on the quality of the code,
○ Browser wars, “IE only websites”.
● The framework era (2006 ~ 2011)
○ A continuation of the browser wars,
○ The popularization of using frameworks,
○ The beginnings of a systematic html,
○ The birth of jquery,
○ PHP 5.3,
○ A stable version of jshint.
● The era of standardization and good practices (~> 2012)
○ PSR standards,
○ The popularization of nodejs, grunt, gulp, angularjs,
○ An emphasis on the quality of the code.
Generally accepted good practices
● Do Not Repeat Yourself (DRY).
● S.O.L.I.D.
● Separation of concerns.
● Fat models skinny controllers.
● Object calisthenics.
An overview of PHP standards
● PSR-0 and PSR-4
○ Define the functioning of an autoloader,
○ Introduce a unification in the method of organizing the code.
● PSR-1
○ Unifies code styles on the basic level,
○ Unifies character coding for php source files,
○ Unifies the naming of classes, methods, and variables.
● PSR-2
○ Unifies the style of the code on a higher level,
○ Unifies the size of the “indentations”,
○ Unifies how if, for, foreach, while constructions should look like.
An overview of Javascript standards
● Douglas Crockford recommendation
(http://javascript.crockford.com/code.html)
● Google JavaScript Style Guide
(https://google.github.io/styleguide/javascriptguide.xml)
An overview of PHP tools
● PHP Code sniffer,
● PHP Mess detector,
● PDepend,
● PHP copy paste detector,
● PHP Coding standards fixer.
PHP CodeSniffer
● Verifies the code in terms of its accordance with the generally accepted good
practices
○ Clean Code (SOLID),
○ Unused code,
○ Verifying the complexity of the code.
● Allows to define own rules.
● Integrates itself with popular editors and programming environments
○ Atom,
○ Sublime Text,
○ PHPStorm.
● Most systems of Continuous Integration include the possibility to run this tool as an
element of the process
● It’s good to integrate this tool on the editor level.
PHP Mess detector
● Verifies the code in terms of its accordance with PSR standards.
● Allows to define own standards.
● Integrates with popular editors and programming environments
○ Atom,
○ Sublime Text,
○ PHPStorm.
● Most systems of Continuous Integration include the possibility to run this tool
as an element of the process.
● It’s good to integrate this tool on the editor level.
PDepend
● Collects data and creates statistics concerning the code.
● Includes a wide array of programming software metrics.
● Most systems of Continuous Integration include the possibility to run this
tool as an element of the process.
● This tool will work best as a part of the Continuous Integration process.
PHP Copy/Paste detector
● Detects a copied code, as suggested by the name.
● Most CI systems support this tool.
● It will work best as an element of the CI process.
PHP Coding standards fixer
● Allows to automatically adjust the code to PSR standards.
● It is possible to use it in the CI process.
● It will work best as a tool used from time to time when we are dealing with
a legacy code.
An overview of Javascript tools
● JsLint,
● JsHint,
● EsLint.
An overview of tools for Javascript: JsLint
● Created by Douglas Crockford.
● The first tool to verify the quality of the JS code.
● Does not include configuration options.
● Bases on the set of good practices created by Crockford and
named “Javascirpt - the good parts”.
● Popular editors offer integration with this tool.
● Most CI systems support this tool.
An overview of tools for Javascript: JsHint
● “The successor” of JSLint.
● A more liberal tool.
● There is an option to configure the tool’s behavior.
● A basic support for the new version of JS (ES6).
● Popular editors offer integration with this tool.
● Most CI systems offer support for this tool.
An overview of tools for Javascript: EsLint
● Close to JsHint.
● Includes the possibility to implement own coding rules and standards.
● There is the option to configure the tool’ behavior.
● Full support for the new version of JS (ES6).
● Popular editors allow to integrate with this tool.
● Most CI systems support this tool.
Working with Continuous Integration systems (CI)
● All tools listed in this presentation work with CI systems.
● Thanks to a proper configuration of these tools we may force the developers
to create a code accordant with our conventions.
● This way we can save the time needed for code review and be sure that
errors will be detected.
Summary
● Both PHP and Javascript don’t prevent creating low quality codes themselves.
● There are tools making it possible to automatically maintain the code’s quality.
● Long-lasting efforts of communities were needed to create these tools.
● Thanks to these tools we can save the time needed for Code Review, and
thanks to the integration with Continuous Integration systems we can also be
more positive that any errors are going to be detected.
Thank you!
Questions?
Ad

More Related Content

What's hot (20)

Git intro fajar muslim
Git intro fajar muslimGit intro fajar muslim
Git intro fajar muslim
Jesslyn Nathania
 
Tdd presentation
Tdd presentationTdd presentation
Tdd presentation
fernando_chimicoviaki
 
Boosting python web apps with protocol buffers & grpc
Boosting python web apps with protocol buffers & grpcBoosting python web apps with protocol buffers & grpc
Boosting python web apps with protocol buffers & grpc
Naren Arya
 
Successful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine RankingsSuccessful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine Rankings
Joomla Day South Africa
 
Craate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo SurabayaCraate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo Surabaya
DILo Surabaya
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django Basics
RahilMemon5
 
Webdev bootcamp
Webdev bootcampWebdev bootcamp
Webdev bootcamp
DSCMESCOE
 
seminar_ppt (copy)
seminar_ppt (copy)seminar_ppt (copy)
seminar_ppt (copy)
Kavin Babu
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
IanDavidson56
 
Ready, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming languageReady, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming language
RTigger
 
Using twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsUsing twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensions
Roberto Segura
 
Goodpractice
GoodpracticeGoodpractice
Goodpractice
Lorna Mitchell
 
How to become a python developer?
How to become a python developer?How to become a python developer?
How to become a python developer?
Mohamed Magdy
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
Rafael Rosa
 
Debugging (Django) application in PyCharm
Debugging (Django) application in PyCharmDebugging (Django) application in PyCharm
Debugging (Django) application in PyCharm
pavelkoci
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Luis Rivera
 
Besut Kode Challenge 1
Besut Kode Challenge 1Besut Kode Challenge 1
Besut Kode Challenge 1
John Vandenberg
 
Writing clean scientific software Murphy cleancoding
Writing clean scientific software Murphy cleancodingWriting clean scientific software Murphy cleancoding
Writing clean scientific software Murphy cleancoding
saber tabatabaee
 
Presentasi jlp
Presentasi jlpPresentasi jlp
Presentasi jlp
Ikhsan Noor Rosyidin
 
Last Month in PHP - November 2016
Last Month in PHP - November 2016Last Month in PHP - November 2016
Last Month in PHP - November 2016
Eric Poe
 
Boosting python web apps with protocol buffers & grpc
Boosting python web apps with protocol buffers & grpcBoosting python web apps with protocol buffers & grpc
Boosting python web apps with protocol buffers & grpc
Naren Arya
 
Successful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine RankingsSuccessful Joomla migrations that don't hurt Search Engine Rankings
Successful Joomla migrations that don't hurt Search Engine Rankings
Joomla Day South Africa
 
Craate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo SurabayaCraate Your Own PHP Package - DILo Surabaya
Craate Your Own PHP Package - DILo Surabaya
DILo Surabaya
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django Basics
RahilMemon5
 
Webdev bootcamp
Webdev bootcampWebdev bootcamp
Webdev bootcamp
DSCMESCOE
 
seminar_ppt (copy)
seminar_ppt (copy)seminar_ppt (copy)
seminar_ppt (copy)
Kavin Babu
 
Advantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
IanDavidson56
 
Ready, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming languageReady, set, go! An introduction to the Go programming language
Ready, set, go! An introduction to the Go programming language
RTigger
 
Using twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsUsing twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensions
Roberto Segura
 
How to become a python developer?
How to become a python developer?How to become a python developer?
How to become a python developer?
Mohamed Magdy
 
Montreal.rb ruby debugging basics - march 20th 2012
Montreal.rb   ruby debugging basics - march 20th 2012Montreal.rb   ruby debugging basics - march 20th 2012
Montreal.rb ruby debugging basics - march 20th 2012
Rafael Rosa
 
Debugging (Django) application in PyCharm
Debugging (Django) application in PyCharmDebugging (Django) application in PyCharm
Debugging (Django) application in PyCharm
pavelkoci
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Luis Rivera
 
Writing clean scientific software Murphy cleancoding
Writing clean scientific software Murphy cleancodingWriting clean scientific software Murphy cleancoding
Writing clean scientific software Murphy cleancoding
saber tabatabaee
 
Last Month in PHP - November 2016
Last Month in PHP - November 2016Last Month in PHP - November 2016
Last Month in PHP - November 2016
Eric Poe
 

Similar to The automation of the process of caring for the quality of the code in PHP and JavaScript | Codesushi - Rzeszow 2016 (20)

PHP Code Quality
PHP Code QualityPHP Code Quality
PHP Code Quality
Usman Zafar
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
Software Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous Inspection
Josh Gough
 
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Andrew Yatsenko
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In Php
Wilco Jansen
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
Dave Cross
 
Applied Machine learning for business analytics
Applied Machine learning for business analyticsApplied Machine learning for business analytics
Applied Machine learning for business analytics
meghu123
 
Pentester++
Pentester++Pentester++
Pentester++
CTruncer
 
Buildmanagment tools mavenandgradle.pptx
Buildmanagment tools mavenandgradle.pptxBuildmanagment tools mavenandgradle.pptx
Buildmanagment tools mavenandgradle.pptx
praveena210336
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
Hùng Nguyễn Huy
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
Mukta Aphale
 
Framework
FrameworkFramework
Framework
Seungjoon Lee
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
Stanislav Petrov
 
Software maintenance PyConPL 2016
Software maintenance PyConPL 2016Software maintenance PyConPL 2016
Software maintenance PyConPL 2016
Cesar Cardenas Desales
 
What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...
kzayra69
 
JS-formatter
JS-formatterJS-formatter
JS-formatter
kimsrung lov
 
Introduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibusIntroduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibus
Davide Fella
 
Code Inspection
Code InspectionCode Inspection
Code Inspection
Fáber D. Giraldo
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Tim Burks
 
Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"
Fwdays
 
PHP Code Quality
PHP Code QualityPHP Code Quality
PHP Code Quality
Usman Zafar
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
Software Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous Inspection
Josh Gough
 
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
Andrew Yatsenko
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In Php
Wilco Jansen
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
Dave Cross
 
Applied Machine learning for business analytics
Applied Machine learning for business analyticsApplied Machine learning for business analytics
Applied Machine learning for business analytics
meghu123
 
Pentester++
Pentester++Pentester++
Pentester++
CTruncer
 
Buildmanagment tools mavenandgradle.pptx
Buildmanagment tools mavenandgradle.pptxBuildmanagment tools mavenandgradle.pptx
Buildmanagment tools mavenandgradle.pptx
praveena210336
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
Hùng Nguyễn Huy
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
Stanislav Petrov
 
What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...What are the basic key points to focus on while learning Full-stack web devel...
What are the basic key points to focus on while learning Full-stack web devel...
kzayra69
 
Introduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibusIntroduzione a junit + integrazione con archibus
Introduzione a junit + integrazione con archibus
Davide Fella
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Tim Burks
 
Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"
Fwdays
 
Ad

More from Krzysztof (Chris) Ozog (16)

Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Krzysztof (Chris) Ozog
 
21st century problem… the cost of it department!
21st century problem… the cost of it department!21st century problem… the cost of it department!
21st century problem… the cost of it department!
Krzysztof (Chris) Ozog
 
Codesushi: Code review z korzyściami dla recenzenta i recenzowanego
Codesushi: Code review z korzyściami dla recenzenta i recenzowanego Codesushi: Code review z korzyściami dla recenzenta i recenzowanego
Codesushi: Code review z korzyściami dla recenzenta i recenzowanego
Krzysztof (Chris) Ozog
 
Why I stopped worrying and loved PHP | Codesushi - Krakow 2017
Why I stopped worrying and loved PHP | Codesushi - Krakow 2017Why I stopped worrying and loved PHP | Codesushi - Krakow 2017
Why I stopped worrying and loved PHP | Codesushi - Krakow 2017
Krzysztof (Chris) Ozog
 
Parallel development of Web Apps | Codesushi - Gliwice 2017
Parallel development of Web Apps | Codesushi - Gliwice  2017Parallel development of Web Apps | Codesushi - Gliwice  2017
Parallel development of Web Apps | Codesushi - Gliwice 2017
Krzysztof (Chris) Ozog
 
How to create a WordPress not understanding WordPress, so more on the headles...
How to create a WordPress not understanding WordPress, so more on the headles...How to create a WordPress not understanding WordPress, so more on the headles...
How to create a WordPress not understanding WordPress, so more on the headles...
Krzysztof (Chris) Ozog
 
Asynchronous PHP | Codesushi - Warsaw 2017
Asynchronous PHP | Codesushi - Warsaw 2017Asynchronous PHP | Codesushi - Warsaw 2017
Asynchronous PHP | Codesushi - Warsaw 2017
Krzysztof (Chris) Ozog
 
How to protect your code against a destructive influence of client | Codesush...
How to protect your code against a destructive influence of client | Codesush...How to protect your code against a destructive influence of client | Codesush...
How to protect your code against a destructive influence of client | Codesush...
Krzysztof (Chris) Ozog
 
Migration from drupal 7 to drupal 8
Migration from drupal 7 to drupal 8Migration from drupal 7 to drupal 8
Migration from drupal 7 to drupal 8
Krzysztof (Chris) Ozog
 
Headless approach and acquia - case study | Codesushi
Headless approach and acquia  - case study | CodesushiHeadless approach and acquia  - case study | Codesushi
Headless approach and acquia - case study | Codesushi
Krzysztof (Chris) Ozog
 
Asynchroniczny PHP | Codesushi
Asynchroniczny PHP | CodesushiAsynchroniczny PHP | Codesushi
Asynchroniczny PHP | Codesushi
Krzysztof (Chris) Ozog
 
Równoległy rozwój Aplikacji Webowych | Codesushi
Równoległy rozwój Aplikacji Webowych | CodesushiRównoległy rozwój Aplikacji Webowych | Codesushi
Równoległy rozwój Aplikacji Webowych | Codesushi
Krzysztof (Chris) Ozog
 
Jak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | Codesushi
Jak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | CodesushiJak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | Codesushi
Jak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | Codesushi
Krzysztof (Chris) Ozog
 
Why I stopped worrying and LOVED PHP | Codesushi
Why I stopped  worrying and  LOVED PHP | CodesushiWhy I stopped  worrying and  LOVED PHP | Codesushi
Why I stopped worrying and LOVED PHP | Codesushi
Krzysztof (Chris) Ozog
 
Inner Symfony’s Daemons
 Inner Symfony’s Daemons Inner Symfony’s Daemons
Inner Symfony’s Daemons
Krzysztof (Chris) Ozog
 
Speed up your zombies! - Bootstrap dev environment in 5 minutes!
Speed up your zombies! - Bootstrap dev environment in 5 minutes!Speed up your zombies! - Bootstrap dev environment in 5 minutes!
Speed up your zombies! - Bootstrap dev environment in 5 minutes!
Krzysztof (Chris) Ozog
 
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Code Camp NYC 2017 - How to deal with everything... | Chris Ozog - Codesushi
Krzysztof (Chris) Ozog
 
21st century problem… the cost of it department!
21st century problem… the cost of it department!21st century problem… the cost of it department!
21st century problem… the cost of it department!
Krzysztof (Chris) Ozog
 
Codesushi: Code review z korzyściami dla recenzenta i recenzowanego
Codesushi: Code review z korzyściami dla recenzenta i recenzowanego Codesushi: Code review z korzyściami dla recenzenta i recenzowanego
Codesushi: Code review z korzyściami dla recenzenta i recenzowanego
Krzysztof (Chris) Ozog
 
Why I stopped worrying and loved PHP | Codesushi - Krakow 2017
Why I stopped worrying and loved PHP | Codesushi - Krakow 2017Why I stopped worrying and loved PHP | Codesushi - Krakow 2017
Why I stopped worrying and loved PHP | Codesushi - Krakow 2017
Krzysztof (Chris) Ozog
 
Parallel development of Web Apps | Codesushi - Gliwice 2017
Parallel development of Web Apps | Codesushi - Gliwice  2017Parallel development of Web Apps | Codesushi - Gliwice  2017
Parallel development of Web Apps | Codesushi - Gliwice 2017
Krzysztof (Chris) Ozog
 
How to create a WordPress not understanding WordPress, so more on the headles...
How to create a WordPress not understanding WordPress, so more on the headles...How to create a WordPress not understanding WordPress, so more on the headles...
How to create a WordPress not understanding WordPress, so more on the headles...
Krzysztof (Chris) Ozog
 
Asynchronous PHP | Codesushi - Warsaw 2017
Asynchronous PHP | Codesushi - Warsaw 2017Asynchronous PHP | Codesushi - Warsaw 2017
Asynchronous PHP | Codesushi - Warsaw 2017
Krzysztof (Chris) Ozog
 
How to protect your code against a destructive influence of client | Codesush...
How to protect your code against a destructive influence of client | Codesush...How to protect your code against a destructive influence of client | Codesush...
How to protect your code against a destructive influence of client | Codesush...
Krzysztof (Chris) Ozog
 
Headless approach and acquia - case study | Codesushi
Headless approach and acquia  - case study | CodesushiHeadless approach and acquia  - case study | Codesushi
Headless approach and acquia - case study | Codesushi
Krzysztof (Chris) Ozog
 
Równoległy rozwój Aplikacji Webowych | Codesushi
Równoległy rozwój Aplikacji Webowych | CodesushiRównoległy rozwój Aplikacji Webowych | Codesushi
Równoległy rozwój Aplikacji Webowych | Codesushi
Krzysztof (Chris) Ozog
 
Jak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | Codesushi
Jak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | CodesushiJak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | Codesushi
Jak uchronić Twój piękny kod przed destrukcyjnym wpływem klienta | Codesushi
Krzysztof (Chris) Ozog
 
Why I stopped worrying and LOVED PHP | Codesushi
Why I stopped  worrying and  LOVED PHP | CodesushiWhy I stopped  worrying and  LOVED PHP | Codesushi
Why I stopped worrying and LOVED PHP | Codesushi
Krzysztof (Chris) Ozog
 
Speed up your zombies! - Bootstrap dev environment in 5 minutes!
Speed up your zombies! - Bootstrap dev environment in 5 minutes!Speed up your zombies! - Bootstrap dev environment in 5 minutes!
Speed up your zombies! - Bootstrap dev environment in 5 minutes!
Krzysztof (Chris) Ozog
 
Ad

Recently uploaded (20)

Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Top 10 IT Help Desk Outsourcing Services
Top 10 IT Help Desk Outsourcing ServicesTop 10 IT Help Desk Outsourcing Services
Top 10 IT Help Desk Outsourcing Services
Infrassist Technologies Pvt. Ltd.
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Mastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdfMastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdf
Spiral Mantra
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Mastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdfMastering Advance Window Functions in SQL.pdf
Mastering Advance Window Functions in SQL.pdf
Spiral Mantra
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 

The automation of the process of caring for the quality of the code in PHP and JavaScript | Codesushi - Rzeszow 2016

  • 1. The automation of the process of caring for the quality of the code in PHP and JavaScript
  • 2. … so how to avoid the following situation: źródło: https://pbs.twimg.com/media/Bp1IyS7CYAATIEB.jpg
  • 3. “Two words” about me ● A PHP programmer since 2007. ● CTO at Codesushi since 2013. ● A clean code preacher.
  • 4. The plan, so what will this be about ● A bit of history, meaning the origins of the discussed tools. ● An overview of standards and good practices. ● An overview of tools supporting PHP. ● An overview of tools supporting Javascript. ● Taking advantage of tools in a local work environment. ● Taking advantage of tools in the continuous integration process.
  • 5. Some history ● The spaghetti code era (~2006) ○ Mainly focused on the execution of projects and not on the quality of the code, ○ Browser wars, “IE only websites”. ● The framework era (2006 ~ 2011) ○ A continuation of the browser wars, ○ The popularization of using frameworks, ○ The beginnings of a systematic html, ○ The birth of jquery, ○ PHP 5.3, ○ A stable version of jshint. ● The era of standardization and good practices (~> 2012) ○ PSR standards, ○ The popularization of nodejs, grunt, gulp, angularjs, ○ An emphasis on the quality of the code.
  • 6. Generally accepted good practices ● Do Not Repeat Yourself (DRY). ● S.O.L.I.D. ● Separation of concerns. ● Fat models skinny controllers. ● Object calisthenics.
  • 7. An overview of PHP standards ● PSR-0 and PSR-4 ○ Define the functioning of an autoloader, ○ Introduce a unification in the method of organizing the code. ● PSR-1 ○ Unifies code styles on the basic level, ○ Unifies character coding for php source files, ○ Unifies the naming of classes, methods, and variables. ● PSR-2 ○ Unifies the style of the code on a higher level, ○ Unifies the size of the “indentations”, ○ Unifies how if, for, foreach, while constructions should look like.
  • 8. An overview of Javascript standards ● Douglas Crockford recommendation (http://javascript.crockford.com/code.html) ● Google JavaScript Style Guide (https://google.github.io/styleguide/javascriptguide.xml)
  • 9. An overview of PHP tools ● PHP Code sniffer, ● PHP Mess detector, ● PDepend, ● PHP copy paste detector, ● PHP Coding standards fixer.
  • 10. PHP CodeSniffer ● Verifies the code in terms of its accordance with the generally accepted good practices ○ Clean Code (SOLID), ○ Unused code, ○ Verifying the complexity of the code. ● Allows to define own rules. ● Integrates itself with popular editors and programming environments ○ Atom, ○ Sublime Text, ○ PHPStorm. ● Most systems of Continuous Integration include the possibility to run this tool as an element of the process ● It’s good to integrate this tool on the editor level.
  • 11. PHP Mess detector ● Verifies the code in terms of its accordance with PSR standards. ● Allows to define own standards. ● Integrates with popular editors and programming environments ○ Atom, ○ Sublime Text, ○ PHPStorm. ● Most systems of Continuous Integration include the possibility to run this tool as an element of the process. ● It’s good to integrate this tool on the editor level.
  • 12. PDepend ● Collects data and creates statistics concerning the code. ● Includes a wide array of programming software metrics. ● Most systems of Continuous Integration include the possibility to run this tool as an element of the process. ● This tool will work best as a part of the Continuous Integration process.
  • 13. PHP Copy/Paste detector ● Detects a copied code, as suggested by the name. ● Most CI systems support this tool. ● It will work best as an element of the CI process.
  • 14. PHP Coding standards fixer ● Allows to automatically adjust the code to PSR standards. ● It is possible to use it in the CI process. ● It will work best as a tool used from time to time when we are dealing with a legacy code.
  • 15. An overview of Javascript tools ● JsLint, ● JsHint, ● EsLint.
  • 16. An overview of tools for Javascript: JsLint ● Created by Douglas Crockford. ● The first tool to verify the quality of the JS code. ● Does not include configuration options. ● Bases on the set of good practices created by Crockford and named “Javascirpt - the good parts”. ● Popular editors offer integration with this tool. ● Most CI systems support this tool.
  • 17. An overview of tools for Javascript: JsHint ● “The successor” of JSLint. ● A more liberal tool. ● There is an option to configure the tool’s behavior. ● A basic support for the new version of JS (ES6). ● Popular editors offer integration with this tool. ● Most CI systems offer support for this tool.
  • 18. An overview of tools for Javascript: EsLint ● Close to JsHint. ● Includes the possibility to implement own coding rules and standards. ● There is the option to configure the tool’ behavior. ● Full support for the new version of JS (ES6). ● Popular editors allow to integrate with this tool. ● Most CI systems support this tool.
  • 19. Working with Continuous Integration systems (CI) ● All tools listed in this presentation work with CI systems. ● Thanks to a proper configuration of these tools we may force the developers to create a code accordant with our conventions. ● This way we can save the time needed for code review and be sure that errors will be detected.
  • 20. Summary ● Both PHP and Javascript don’t prevent creating low quality codes themselves. ● There are tools making it possible to automatically maintain the code’s quality. ● Long-lasting efforts of communities were needed to create these tools. ● Thanks to these tools we can save the time needed for Code Review, and thanks to the integration with Continuous Integration systems we can also be more positive that any errors are going to be detected.