SlideShare a Scribd company logo
1 of 14
Download to read offline
Php Inspections (EA Extended)*:
The Cookbook
* Extended for Enterprise Applications
@kalessil
github.com/kalessil
www.patreon.com/kalessil
Key features
● Saves your time and nerve cells
● How:
○ Pitfalls and bugs detection
○ Null references detection
○ Exceptions handling workflow analysis
○ Performance (high-load) analysis
○ Regex and core APIs usage analysis
○ Quick-Fixes for most of inspections
Dealing with legacy (and enterprise muhahaha)
Stop! That’s new code!
● Enable deactivated inspections
● Keep files “green”
●
Safety prerequisites
● PhpUnit
○ Unit-Testing framework
○ Mandatory safety requisite
● phpspec
○ Behaviour-Testing framework
○ Great addition to safety
* false-positives + edge cases are popping up constantly
Clean up workspace
PHP Coding Standards Fixer
● Automatically applies CS
● CI friendly
● Flexible configuration
● Play with enabling risky fixers
○ Some are contributed by me;
○ Some are rules ported from us;
Sharing configuration
● Tweak Project Default settings
● Share your work:
○ VCS <- .idea/inspectionProfiles/*
■ IDE headless mode friendly
■ Github: kalessil/phpstorm-inspect
○ Settings Repository plugin
■ File -> Settings Repository
● Review config changes regularly
○ Track new inspections
○ Track inspections settings
Hints before the first run
● Give IDE enough memory
○ Where: Help -> Diagnostic -> Change memory settings
○ Why: https://dzone.com/articles/the-one-and-only-reason-to-customize-intellij-idea
● Architecture -> Multiple return statements usage
○ Worth enabling, the early returns is not as good solution as you might think
● Review settings
○ Code style -> Increment/decrement operation equivalent
○ Code style -> Self class referencing
○ Code style -> Static method invocation via ‘->’
○ Code style -> Yoda/regular conditions style usage
○ Control Flow -> Exceptions handling and annotating
○ Control Flow -> Not optimal if conditions
○ Language level migration -> ‘null === ’ can be used
○ Probable bugs -> Forgotten debug statements
First run
● Check project language level settings
○ Our inspections are respecting the language level =)
● Check ‘Code Style -> Unknown inspection suppression’ results:
○ Perhaps you are missing some plugins;
● Check ‘Security -> *’ results
○ And our GitHub documentation for them with some hints
● Check ‘Probable bugs -> *’ results
○ It’s difficult to predict what you are going to find there
● Check ‘Compatibility -> *’ results
○ You never know how old the legacy code can be
Where to start
● Some of rules might be irrelevant for the project
○ Deactivate and push config changes into a repository
● Group result by severity
○
● Start cleaning up messages
○ Ideally at the beginning of a new sprint
○ Ideally in the module which gets most of changes during the sprint
■ Higher probability to find unnoticed side-effects
○ Separate code CS changes and issues fixes
What’s next?
● Once you get through the first round:
○ Language level migration
○ Performance
■ reward yourself =)
○ Control flow
■ Enables more SCA checks
● Foreach
● Core APIs
● Conditional statements
○ Unused (drop the dead code)
■ this always feels good =)
● Repeat - SCA is a continuous process
Survival mode
@kalessil
github.com/kalessil
www.patreon.com/kalessil
Thank you

More Related Content

What's hot

Automated Performance Testing
Automated Performance TestingAutomated Performance Testing
Automated Performance TestingLars Thorup
 
PyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedPyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedAlessandro Molina
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated TestingLars Thorup
 
Antifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureAntifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureDiUS
 
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 RankingsJoomla Day South Africa
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Alin Pandichi
 
2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CDSimon Bennetts
 
Introduction to test driven development
Introduction to test driven developmentIntroduction to test driven development
Introduction to test driven developmentBrian Hogg
 
Getting your project_started
Getting your project_startedGetting your project_started
Getting your project_startedAdam Culp
 
TDD with Python and App Engine
TDD with Python and App EngineTDD with Python and App Engine
TDD with Python and App EngineRicardo Bánffy
 
2020 OWASP Thailand - ZAP intro
2020 OWASP Thailand - ZAP intro2020 OWASP Thailand - ZAP intro
2020 OWASP Thailand - ZAP introSimon Bennetts
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneMichael Kuehne-Schlinkert
 
Gatling Performance Workshop
Gatling Performance WorkshopGatling Performance Workshop
Gatling Performance WorkshopSai Krishna
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React? Lisa Gagarina
 
Schedulers and Timers in Akka
Schedulers and Timers in AkkaSchedulers and Timers in Akka
Schedulers and Timers in AkkaKnoldus Inc.
 

What's hot (20)

Automated Performance Testing
Automated Performance TestingAutomated Performance Testing
Automated Performance Testing
 
PyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development UpdatedPyConUK 2014 - PostMortem Debugging and Web Development Updated
PyConUK 2014 - PostMortem Debugging and Web Development Updated
 
Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Antifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failureAntifragility and testing for distributed systems failure
Antifragility and testing for distributed systems failure
 
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
 
Test your code
Test your codeTest your code
Test your code
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
 
2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD
 
Introduction to test driven development
Introduction to test driven developmentIntroduction to test driven development
Introduction to test driven development
 
Getting your project_started
Getting your project_startedGetting your project_started
Getting your project_started
 
TDD with Python and App Engine
TDD with Python and App EngineTDD with Python and App Engine
TDD with Python and App Engine
 
2020 OWASP Thailand - ZAP intro
2020 OWASP Thailand - ZAP intro2020 OWASP Thailand - ZAP intro
2020 OWASP Thailand - ZAP intro
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
Test driving QML
Test driving QMLTest driving QML
Test driving QML
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
 
Sonar Review
Sonar ReviewSonar Review
Sonar Review
 
Gatling Performance Workshop
Gatling Performance WorkshopGatling Performance Workshop
Gatling Performance Workshop
 
How to go about testing in React?
How to go about testing in React? How to go about testing in React?
How to go about testing in React?
 
Schedulers and Timers in Akka
Schedulers and Timers in AkkaSchedulers and Timers in Akka
Schedulers and Timers in Akka
 

Similar to Php Inspections (EA Extended): The Cookbook

The 10 Commandments of Release Engineering
The 10 Commandments of Release EngineeringThe 10 Commandments of Release Engineering
The 10 Commandments of Release EngineeringSolano Labs
 
Security in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersSecurity in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersDevOps.com
 
QA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsQA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsRainforest QA
 
Scaling Magento
Scaling MagentoScaling Magento
Scaling MagentoCopious
 
Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentationDrew Hannay
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your codeTest driven development - Zombie proof your code
Test driven development - Zombie proof your codePascal Larocque
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingShyam Sunder Verma
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best PracitcesJustin Filip
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)Thierry Gayet
 
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3Jacek Gebal
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Giovanni Toraldo
 
Pentester++
Pentester++Pentester++
Pentester++CTruncer
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentationAhmed Kamel
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
 
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 2020Andrew Yatsenko
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional ProgrammerDave Cross
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonIneke Scheffers
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGPablo Garbossa
 
Legacy code development and maintenance
Legacy code development and maintenanceLegacy code development and maintenance
Legacy code development and maintenanceDenis Kondratenko
 

Similar to Php Inspections (EA Extended): The Cookbook (20)

The 10 Commandments of Release Engineering
The 10 Commandments of Release EngineeringThe 10 Commandments of Release Engineering
The 10 Commandments of Release Engineering
 
Security in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps EngineersSecurity in CI/CD Pipelines: Tips for DevOps Engineers
Security in CI/CD Pipelines: Tips for DevOps Engineers
 
QA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web AppsQA Strategies for Testing Legacy Web Apps
QA Strategies for Testing Legacy Web Apps
 
Scaling Magento
Scaling MagentoScaling Magento
Scaling Magento
 
Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentation
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your codeTest driven development - Zombie proof your code
Test driven development - Zombie proof your code
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best Pracitces
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)
 
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
Pentester++
Pentester++Pentester++
Pentester++
 
Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentation
 
Software maintenance PyConPL 2016
Software maintenance PyConPL 2016Software maintenance PyConPL 2016
Software maintenance PyConPL 2016
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
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
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
 
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORINGEko10 workshop - OPEN SOURCE DATABASE MONITORING
Eko10 workshop - OPEN SOURCE DATABASE MONITORING
 
Legacy code development and maintenance
Legacy code development and maintenanceLegacy code development and maintenance
Legacy code development and maintenance
 

Recently uploaded

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 

Recently uploaded (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

Php Inspections (EA Extended): The Cookbook

  • 1. Php Inspections (EA Extended)*: The Cookbook * Extended for Enterprise Applications
  • 3. Key features ● Saves your time and nerve cells ● How: ○ Pitfalls and bugs detection ○ Null references detection ○ Exceptions handling workflow analysis ○ Performance (high-load) analysis ○ Regex and core APIs usage analysis ○ Quick-Fixes for most of inspections
  • 4. Dealing with legacy (and enterprise muhahaha)
  • 5. Stop! That’s new code! ● Enable deactivated inspections ● Keep files “green” ●
  • 6. Safety prerequisites ● PhpUnit ○ Unit-Testing framework ○ Mandatory safety requisite ● phpspec ○ Behaviour-Testing framework ○ Great addition to safety * false-positives + edge cases are popping up constantly
  • 7. Clean up workspace PHP Coding Standards Fixer ● Automatically applies CS ● CI friendly ● Flexible configuration ● Play with enabling risky fixers ○ Some are contributed by me; ○ Some are rules ported from us;
  • 8. Sharing configuration ● Tweak Project Default settings ● Share your work: ○ VCS <- .idea/inspectionProfiles/* ■ IDE headless mode friendly ■ Github: kalessil/phpstorm-inspect ○ Settings Repository plugin ■ File -> Settings Repository ● Review config changes regularly ○ Track new inspections ○ Track inspections settings
  • 9. Hints before the first run ● Give IDE enough memory ○ Where: Help -> Diagnostic -> Change memory settings ○ Why: https://dzone.com/articles/the-one-and-only-reason-to-customize-intellij-idea ● Architecture -> Multiple return statements usage ○ Worth enabling, the early returns is not as good solution as you might think ● Review settings ○ Code style -> Increment/decrement operation equivalent ○ Code style -> Self class referencing ○ Code style -> Static method invocation via ‘->’ ○ Code style -> Yoda/regular conditions style usage ○ Control Flow -> Exceptions handling and annotating ○ Control Flow -> Not optimal if conditions ○ Language level migration -> ‘null === ’ can be used ○ Probable bugs -> Forgotten debug statements
  • 10. First run ● Check project language level settings ○ Our inspections are respecting the language level =) ● Check ‘Code Style -> Unknown inspection suppression’ results: ○ Perhaps you are missing some plugins; ● Check ‘Security -> *’ results ○ And our GitHub documentation for them with some hints ● Check ‘Probable bugs -> *’ results ○ It’s difficult to predict what you are going to find there ● Check ‘Compatibility -> *’ results ○ You never know how old the legacy code can be
  • 11. Where to start ● Some of rules might be irrelevant for the project ○ Deactivate and push config changes into a repository ● Group result by severity ○ ● Start cleaning up messages ○ Ideally at the beginning of a new sprint ○ Ideally in the module which gets most of changes during the sprint ■ Higher probability to find unnoticed side-effects ○ Separate code CS changes and issues fixes
  • 12. What’s next? ● Once you get through the first round: ○ Language level migration ○ Performance ■ reward yourself =) ○ Control flow ■ Enables more SCA checks ● Foreach ● Core APIs ● Conditional statements ○ Unused (drop the dead code) ■ this always feels good =) ● Repeat - SCA is a continuous process