SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
Code Quality Tools for Dev
Rejah Rehim
Maintainable code base
Code reuse (avoid code repetition)
—  avoid complicated nested loops
—  Encapsulation (organize code in classes)
—  Code Documentation
—  Consistent code conventions ( Code consistency)
PHP
PHP Mess Detector
●  PHP Copy Paste Detector
●  PHP Code Sniffer
PHP Mess Detector ( PHP MD )
Trying to be equivalent of Java Tool PMD Looks for
potential problems such as :
•  if your function is too long
•  if your function has too many
parameters
•  variable names too long or too short
•  too many nested cycles
•  Use of eval()
•  Name of covention
consistency
•  Unused methodes or
variables
PHP MD
Installation
$ pear channel-discover pear.phpmd.org
$ pear channel-discover pear.pdepend.org
$ pear install --alldeps phpmd/PHP_PMD
PHP MD
Usage
phpmd [directory name] [format] [rule]
directory name = php directory
format = xml, text, html
rules = any of the available rules
http://phpmd.org/rules/index.html
PHP Copy Paste Detector - PHP CPD
●  Find Duplicated Code (
http://en.wikipedia.org/wiki/Duplicate_code)
Installing PHP CPD
●  pear config-set auto_discover 1
●  pear install pear.phpunit.de/phpcpd
Usage
●  phpcpd [directoryname]
PHP Code Sniffer
PHP 5 script
●  Tokenises your php, javascript, css files
●  Detects violations of a defined set of coding standards
Installation
pear install PHP_CodeSniffer-1.5.0RC3
Usage
phpcs --extensions=php [directory]
Demo
●  Command line
●  With Sublime Text Module
Thank you

Mais conteúdo relacionado

Mais procurados

Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
julien pauli
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
julien pauli
 
walkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventionswalkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventions
walkmod
 

Mais procurados (20)

Introduction to writing readable and maintainable Perl
Introduction to writing readable and maintainable PerlIntroduction to writing readable and maintainable Perl
Introduction to writing readable and maintainable Perl
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
 
PHP Optimization
PHP OptimizationPHP Optimization
PHP Optimization
 
rtwerewr
rtwerewrrtwerewr
rtwerewr
 
Hacking with hhvm
Hacking with hhvmHacking with hhvm
Hacking with hhvm
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
Introduction to Writing Readable and Maintainable Perl (YAPC::EU 2011 Version)
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 
Building Custom PHP Extensions
Building Custom PHP ExtensionsBuilding Custom PHP Extensions
Building Custom PHP Extensions
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
 
Cross platform php
Cross platform phpCross platform php
Cross platform php
 
walkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventionswalkmod: An open source tool for coding conventions
walkmod: An open source tool for coding conventions
 
Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!
 
Introduction to protocol buffer
Introduction to protocol bufferIntroduction to protocol buffer
Introduction to protocol buffer
 
IO Streams, Files and Directories
IO Streams, Files and DirectoriesIO Streams, Files and Directories
IO Streams, Files and Directories
 
walkmod - JUG talk
walkmod - JUG talkwalkmod - JUG talk
walkmod - JUG talk
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 

Destaque

สรุปประเด็นเอดส์เพศ
สรุปประเด็นเอดส์เพศสรุปประเด็นเอดส์เพศ
สรุปประเด็นเอดส์เพศ
Whuttikhon Phuttikul
 
Mt1[1] sjkt new bala edit 24 apr
Mt1[1] sjkt new bala edit 24 aprMt1[1] sjkt new bala edit 24 apr
Mt1[1] sjkt new bala edit 24 apr
SELVAM PERUMAL
 
General mozilla chrome addons
General mozilla chrome addonsGeneral mozilla chrome addons
General mozilla chrome addons
Deepu S Nath
 
Percubaan bt johor k2 2013
Percubaan bt johor k2 2013Percubaan bt johor k2 2013
Percubaan bt johor k2 2013
SELVAM PERUMAL
 
Test transformation
Test transformationTest transformation
Test transformation
Deepu S Nath
 
Platform as a service google app engine
Platform as a service   google app enginePlatform as a service   google app engine
Platform as a service google app engine
Deepu S Nath
 

Destaque (16)

สรุปประเด็นเอดส์เพศ
สรุปประเด็นเอดส์เพศสรุปประเด็นเอดส์เพศ
สรุปประเด็นเอดส์เพศ
 
Bug Advocacy
Bug AdvocacyBug Advocacy
Bug Advocacy
 
Sn sjkt sec a
Sn sjkt sec aSn sjkt sec a
Sn sjkt sec a
 
Mt1[1] sjkt new bala edit 24 apr
Mt1[1] sjkt new bala edit 24 aprMt1[1] sjkt new bala edit 24 apr
Mt1[1] sjkt new bala edit 24 apr
 
General mozilla chrome addons
General mozilla chrome addonsGeneral mozilla chrome addons
General mozilla chrome addons
 
Coffee@DBG Techbites - November 2014
 Coffee@DBG Techbites - November 2014 Coffee@DBG Techbites - November 2014
Coffee@DBG Techbites - November 2014
 
3.1 el proceso de desarrollo de la andragogía
3.1 el proceso de desarrollo de la andragogía3.1 el proceso de desarrollo de la andragogía
3.1 el proceso de desarrollo de la andragogía
 
4.1 actividad la educación encierra un tesoro
4.1 actividad la educación encierra un tesoro4.1 actividad la educación encierra un tesoro
4.1 actividad la educación encierra un tesoro
 
Percubaan bt johor k2 2013
Percubaan bt johor k2 2013Percubaan bt johor k2 2013
Percubaan bt johor k2 2013
 
Test transformation
Test transformationTest transformation
Test transformation
 
Fokusupsr2014
Fokusupsr2014Fokusupsr2014
Fokusupsr2014
 
Coffee@DBG - Browser internals
Coffee@DBG - Browser internalsCoffee@DBG - Browser internals
Coffee@DBG - Browser internals
 
6.1 actividad concepto aprendizaje factores que intervienen - tipos de apre...
6.1 actividad concepto aprendizaje   factores que intervienen - tipos de apre...6.1 actividad concepto aprendizaje   factores que intervienen - tipos de apre...
6.1 actividad concepto aprendizaje factores que intervienen - tipos de apre...
 
Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JS
 
Coffee@DBG - HTML 5 Trends & Updates
Coffee@DBG - HTML 5   Trends & UpdatesCoffee@DBG - HTML 5   Trends & Updates
Coffee@DBG - HTML 5 Trends & Updates
 
Platform as a service google app engine
Platform as a service   google app enginePlatform as a service   google app engine
Platform as a service google app engine
 

Semelhante a Code quality tools for dev

これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Muhamad Al Imran
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13
DanWooster1
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
Jamshid Hashimi
 

Semelhante a Code quality tools for dev (20)

Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Hsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdfHsc IT 5. Server-Side Scripting (PHP).pdf
Hsc IT 5. Server-Side Scripting (PHP).pdf
 
Standard Coding, OOP Techniques and Code Reuse
Standard Coding, OOP Techniques and Code ReuseStandard Coding, OOP Techniques and Code Reuse
Standard Coding, OOP Techniques and Code Reuse
 
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themes
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
 
Wp Presentation
Wp PresentationWp Presentation
Wp Presentation
 
Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8Improved Developer Productivity In JDK8
Improved Developer Productivity In JDK8
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Quality in coding (phpmd & phpcpd with Symfony 2)
Quality in coding (phpmd & phpcpd with Symfony 2)Quality in coding (phpmd & phpcpd with Symfony 2)
Quality in coding (phpmd & phpcpd with Symfony 2)
 
Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13Upstate CSCI 450 PHP Chapters 5, 12, 13
Upstate CSCI 450 PHP Chapters 5, 12, 13
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopment
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
 
phpwebdev.ppt
phpwebdev.pptphpwebdev.ppt
phpwebdev.ppt
 
Introduction to PHP OOP
Introduction to PHP OOPIntroduction to PHP OOP
Introduction to PHP OOP
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best Practices
 

Mais de Deepu S Nath

Greetings & Response - English Communication Training
Greetings & Response - English Communication TrainingGreetings & Response - English Communication Training
Greetings & Response - English Communication Training
Deepu S Nath
 

Mais de Deepu S Nath (20)

Design Thinking, Critical Thinking & Innovation Design
Design Thinking, Critical Thinking & Innovation DesignDesign Thinking, Critical Thinking & Innovation Design
Design Thinking, Critical Thinking & Innovation Design
 
GTECH ATFG µLearn Framework Intro
GTECH ATFG µLearn Framework IntroGTECH ATFG µLearn Framework Intro
GTECH ATFG µLearn Framework Intro
 
Future of learning - Technology Disruption
Future of learning  - Technology DisruptionFuture of learning  - Technology Disruption
Future of learning - Technology Disruption
 
Decentralized Applications using Ethereum
Decentralized Applications using EthereumDecentralized Applications using Ethereum
Decentralized Applications using Ethereum
 
How machines can take decisions
How machines can take decisionsHow machines can take decisions
How machines can take decisions
 
Artificial Intelligence: An Introduction
 Artificial Intelligence: An Introduction Artificial Intelligence: An Introduction
Artificial Intelligence: An Introduction
 
FAYA PORT 80 Introduction
FAYA PORT 80 IntroductionFAYA PORT 80 Introduction
FAYA PORT 80 Introduction
 
How machines can take decisions
How machines can take decisionsHow machines can take decisions
How machines can take decisions
 
Simplified Introduction to AI
Simplified Introduction to AISimplified Introduction to AI
Simplified Introduction to AI
 
Mining Opportunities of Block Chain and BitCoin
Mining Opportunities of Block Chain and BitCoinMining Opportunities of Block Chain and BitCoin
Mining Opportunities of Block Chain and BitCoin
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Coffee@DBG - TechBites March 2016
Coffee@DBG - TechBites March 2016Coffee@DBG - TechBites March 2016
Coffee@DBG - TechBites March 2016
 
REACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScriptREACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScript
 
SEO For Developers
SEO For DevelopersSEO For Developers
SEO For Developers
 
Life Cycle of an App - From Idea to Monetization
Life Cycle of an App - From Idea to Monetization  Life Cycle of an App - From Idea to Monetization
Life Cycle of an App - From Idea to Monetization
 
Uncommon Python - What is special in Python
Uncommon Python -  What is special in PythonUncommon Python -  What is special in Python
Uncommon Python - What is special in Python
 
Coffee@DBG - TechBites Sept 2015
Coffee@DBG - TechBites Sept 2015Coffee@DBG - TechBites Sept 2015
Coffee@DBG - TechBites Sept 2015
 
Techbites July 2015
Techbites July 2015Techbites July 2015
Techbites July 2015
 
Apple Watch - Start Your Developer Engine
Apple Watch -  Start Your Developer EngineApple Watch -  Start Your Developer Engine
Apple Watch - Start Your Developer Engine
 
Greetings & Response - English Communication Training
Greetings & Response - English Communication TrainingGreetings & Response - English Communication Training
Greetings & Response - English Communication Training
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Code quality tools for dev

  • 1. Code Quality Tools for Dev Rejah Rehim
  • 2. Maintainable code base Code reuse (avoid code repetition) —  avoid complicated nested loops —  Encapsulation (organize code in classes) —  Code Documentation —  Consistent code conventions ( Code consistency)
  • 3. PHP PHP Mess Detector ●  PHP Copy Paste Detector ●  PHP Code Sniffer
  • 4. PHP Mess Detector ( PHP MD ) Trying to be equivalent of Java Tool PMD Looks for potential problems such as : •  if your function is too long •  if your function has too many parameters •  variable names too long or too short •  too many nested cycles •  Use of eval() •  Name of covention consistency •  Unused methodes or variables
  • 5. PHP MD Installation $ pear channel-discover pear.phpmd.org $ pear channel-discover pear.pdepend.org $ pear install --alldeps phpmd/PHP_PMD
  • 6. PHP MD Usage phpmd [directory name] [format] [rule] directory name = php directory format = xml, text, html rules = any of the available rules http://phpmd.org/rules/index.html
  • 7. PHP Copy Paste Detector - PHP CPD ●  Find Duplicated Code ( http://en.wikipedia.org/wiki/Duplicate_code) Installing PHP CPD ●  pear config-set auto_discover 1 ●  pear install pear.phpunit.de/phpcpd Usage ●  phpcpd [directoryname]
  • 8. PHP Code Sniffer PHP 5 script ●  Tokenises your php, javascript, css files ●  Detects violations of a defined set of coding standards
  • 10. Demo ●  Command line ●  With Sublime Text Module