SlideShare a Scribd company logo
PHP REVIEWS 

FOR BUSY PEOPLE
IPC, Berlin, Germany 2018
AGENDA
Include code reviews in your coding day
Tips and tricks to do them usefully and quickly
We have no time, let's go to the next slide!
SPEAKER
Damien Seguy
CTO Exakat
Static analysis engine for PHP
Altersheim für Elephpant
Ich spreche kein Deutsch
CODE REVIEW
AS RELAXATION
when the pause is the code review
BOXED TIME REVIEW
15 mins away
from meeting, early at work, about to leave…
avoid a real task by looking usefully busy
Any random time that is free : 10 to 20 mins
Time Box and distraction free
Small and focused fix in the code
WHAT TO
REVIEW?
Garçon, le menu!
REVIEW
Choose
a rule
Fix
Code source
REVIEW
Choose a
rule
Search for
issues
Diagnostic Fix
STATIC ANALYSIS
Code analysis without execution
PHP has a growing list of tools
https://github.com/exakat/php-static-analysis-
tools/
90 tools in the list
STATIC ANALYSIS
PHP 5 / 7
Calisthenics
ClearPHP
Performance
 
 

RELAX AND REVIEW
New feature Meeting
Audit run Audit run
Audit runs
Developer time
Code
review
ON THE HOOK
New feature
Next feature
Ho
ok
Developer time
Co
de
rev
iew
Co
m
mit
ru
nCode review
PHP Inspector
Phan, Psalm, PHPStan
ON THE HOOK
Great for local bugs
Avoid committing errors or violations
May be sidelined by emergency
FAST CHECK
SLOW REVIEW
New feature Meeting
Audit run Audit run
Developer time
Code
review
WHERE IS THE BUG?
<?php
$versions = ['72' => 'Woody', '7.1' => 'Kalla',];
foreach($versions as $short => $full) {
   print $short[0].PHP_EOL;
}
?>
7
DON'T TALK ABOUT BUG
<?php
if (strpos($string, ':') == false) {
   print ": foundn";
} else {
   print ": not foundn";
}
?>
FIX EARLY BUGS
Classic bugs
Easy to understand
Easy to forget
Short list
If not so short, make it shorter
ANYTHING BETTER?
<?php
foreach($results as $result) {
  $cols[] = $result->a;
}
?>
  $cols[] = $result['a'];
<?php
$cols = array_column($result, 'a');
?>
TARGET
Fix bug early
Clean the code
Learn new technique
Reference local idioms
Document code
WHAT AN
HORRIBLE
PATOIS
first you marry, then you statoil!
LOCAL IDIOMS
The way the code is done here
The way the code is done here
FACING THE
HORDE
what if they all came?
FIX EARLY BUGS
Use ++$i, not $i++
Usage of @
Switch without default
printf('%s', $a, $b);
$c = $a + $b - $a +$d
FIX EARLY BUGS
Use ++$i, not $i++
Usage of @
Switch without default
printf('%s', $a, $b);
$c = $a + $b - $a +$d
Easy
Medium
Harder
Easy
Easy
FIX EARLY BUGS
Use ++$i, not $i++
Usage of @
Switch without default
printf('%s', $a, $b);
$c = $a + $b - $a +$d
Easy
Medium
Harder
Easy
Easy
90%
53%
51%
27%
3%
https://www.exakat.io/exakat-coding-index-2018-05/
100 1 2 3 4 5 6 7 8 9
10
0
1
2
3
4
5
6
7
8
9
Difficulty
Frequency
++$i
Switch without default
@
$a - $a Printf()
100 1 2 3 4 5 6 7 8 9
10
0
1
2
3
4
5
6
7
8
9
Difficulty
Frequency
++$i
Switch without default
@
$a - $a Printf()
100 1 2 3 4 5 6 7 8 9
10
0
1
2
3
4
5
6
7
8
9
Difficulty
Frequency
++$i
Switch without default
@
$a - $a Printf()
WE WALK ON TWO LEGS
Discovery
Hunt bugs
DISCOVERY
Undefined variables
Variables used once
Variables written only
Variables used twice : one write, one read
Is order important ?
TEAM INTEGRATION
Discovery
Culture
Hunt bugs
STARTING RIGHT
first month : 10 rules
Next month : 10 other rules and discovery
1 month 2 month 3 month
Rules
CODE REVIEW
AS RELAXATION
when the pause is the code review
CODE REVIEW TIPS
Automate issues search
Select the important rules for you
Do the easy fix first
Always keep an eye open for the next bug
4 hours a week is a good target, in small bits
LINKS
EPIC : https://www.exakat.io/exakat-coding-
index-2018-05/
Exakat : https://www.exakat.io/
Phan : https://github.com/phan/phan
PHP Inspection : https://plugins.jetbrains.com/plugin/
7622-php-inspections-ea-extended-
PHPStan : https://github.com/phpstan/phpstan
DANKE SCHÖN!
https://www.exakat.io/ - @exakat
Code review for busy people
The way the code is done here
EASY TO FIX FIRST
Spot easy to fix first
Fix them without discussion
Or set them out of scope : Not Fixed Here
EASY TO FIX FIRST
Easy to fix
Frequent in the code
Critical to the organization
Quick checks
Slower checks
Conception level
LEVEL OF FIXING
Quick checks
Slower checks
Conception level
Screen size fix
Local Variable
Variable/
properties
Whole class
ELEVATING TRAINING
Move from code to team
In IDE => in repository => documented
EXTRACTING IDIOMS
Move from code to team
In IDE => in repository => documented
AUTOMATED
DOCUMENTATION
Extract information important for all
Read it or transmit it to others
Some of it can be automated
Team work
Team work
Team work
Team work
CODE AS RELAXATION
15 mins are easy to find
You could have brought it here now :)
AUTOMATE WHAT IS
POSSIBLE
PHP version pre-requisite
PHP bugs

More Related Content

What's hot (9)

RTF
Triggers-Sequences-SQL
Patrick Seery
 
PDF
Laravel でやってみるクリーンアーキテクチャ #phpconfuk
Shohei Okada
 
PDF
エラー時にログに出力する情報と画面に表示する情報を分ける #LaravelTokyo
Shohei Okada
 
PDF
The road to continuous deployment (DomCode September 2016)
Michiel Rook
 
PDF
Leveraging a distributed architecture to your advantage
Michelangelo van Dam
 
PDF
Adventures in Laravel and Performance: Looking beyond eloquent
Jamie Hurst
 
PDF
Getting modern with logging via log4perl
Dean Hamstead
 
PPT
TDD, BDD, RSpec
Nascenia IT
 
PDF
Errors, Exceptions & Logging (PHP Hants Oct '13)
James Titcumb
 
Triggers-Sequences-SQL
Patrick Seery
 
Laravel でやってみるクリーンアーキテクチャ #phpconfuk
Shohei Okada
 
エラー時にログに出力する情報と画面に表示する情報を分ける #LaravelTokyo
Shohei Okada
 
The road to continuous deployment (DomCode September 2016)
Michiel Rook
 
Leveraging a distributed architecture to your advantage
Michelangelo van Dam
 
Adventures in Laravel and Performance: Looking beyond eloquent
Jamie Hurst
 
Getting modern with logging via log4perl
Dean Hamstead
 
TDD, BDD, RSpec
Nascenia IT
 
Errors, Exceptions & Logging (PHP Hants Oct '13)
James Titcumb
 

Similar to Code review for busy people (20)

PPTX
Reducing Bugs With Static Code Analysis php tek 2025
Scott Keck-Warren
 
PPT
Code Review
rantav
 
PDF
ChatGPT and Beyond - Elevating DevOps Productivity
VictorSzoltysek
 
PPTX
Static Code Analysis PHP[tek] 2023
Scott Keck-Warren
 
PDF
Serverless in Production, an experience report (cloudXchange)
Yan Cui
 
PDF
Dutch PHP Conference 2013: Distilled
Zumba Fitness - Technology Team
 
PDF
Serverless in production, an experience report (LNUG)
Yan Cui
 
PDF
Review unknown code with static analysis Zend con 2017
Damien Seguy
 
PPTX
No more dead kittens - Clean Code
Yves Hoppe
 
PPTX
Neotys PAC - Stijn Schepers
Neotys_Partner
 
PPTX
Advanced Codeless Testing for Web Apps
Perfecto by Perforce
 
PDF
Workshop quality assurance for php projects - phpdublin
Michelangelo van Dam
 
PDF
DevOps Training - Ho Chi Minh City
Christian Trabold
 
PPTX
C#7, 7.1, 7.2, 7.3 e C# 8
Giovanni Bassi
 
PDF
Web Performance Culture and Tools at Etsy
Mike Brittain
 
KEY
Workshop quality assurance for php projects tek12
Michelangelo van Dam
 
ODP
New Ideas for Old Code - Greach
HamletDRC
 
PDF
Measuring Your Code 2.0
Nate Abele
 
PDF
Measuring Your Code
Nate Abele
 
PDF
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Ondřej Machulda
 
Reducing Bugs With Static Code Analysis php tek 2025
Scott Keck-Warren
 
Code Review
rantav
 
ChatGPT and Beyond - Elevating DevOps Productivity
VictorSzoltysek
 
Static Code Analysis PHP[tek] 2023
Scott Keck-Warren
 
Serverless in Production, an experience report (cloudXchange)
Yan Cui
 
Dutch PHP Conference 2013: Distilled
Zumba Fitness - Technology Team
 
Serverless in production, an experience report (LNUG)
Yan Cui
 
Review unknown code with static analysis Zend con 2017
Damien Seguy
 
No more dead kittens - Clean Code
Yves Hoppe
 
Neotys PAC - Stijn Schepers
Neotys_Partner
 
Advanced Codeless Testing for Web Apps
Perfecto by Perforce
 
Workshop quality assurance for php projects - phpdublin
Michelangelo van Dam
 
DevOps Training - Ho Chi Minh City
Christian Trabold
 
C#7, 7.1, 7.2, 7.3 e C# 8
Giovanni Bassi
 
Web Performance Culture and Tools at Etsy
Mike Brittain
 
Workshop quality assurance for php projects tek12
Michelangelo van Dam
 
New Ideas for Old Code - Greach
HamletDRC
 
Measuring Your Code 2.0
Nate Abele
 
Measuring Your Code
Nate Abele
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Ondřej Machulda
 
Ad

More from Damien Seguy (20)

PDF
Strong typing @ php leeds
Damien Seguy
 
PPTX
Strong typing : adoption, adaptation and organisation
Damien Seguy
 
PDF
Qui a laissé son mot de passe dans le code
Damien Seguy
 
PDF
Analyse statique et applications
Damien Seguy
 
PDF
Top 10 pieges php afup limoges
Damien Seguy
 
PDF
Top 10 php classic traps DPC 2020
Damien Seguy
 
PDF
Meilleur du typage fort (AFUP Day, 2020)
Damien Seguy
 
PDF
Top 10 php classic traps confoo
Damien Seguy
 
PDF
Tout pour se préparer à PHP 7.4
Damien Seguy
 
PDF
Top 10 php classic traps php serbia
Damien Seguy
 
PDF
Top 10 php classic traps
Damien Seguy
 
PDF
Top 10 chausse trappes
Damien Seguy
 
PDF
Code review workshop
Damien Seguy
 
PDF
Understanding static analysis php amsterdam 2018
Damien Seguy
 
PDF
Review unknown code with static analysis php ce 2018
Damien Seguy
 
PDF
Everything new with PHP 7.3
Damien Seguy
 
PDF
Php 7.3 et ses RFC (AFUP Toulouse)
Damien Seguy
 
PDF
Tout sur PHP 7.3 et ses RFC
Damien Seguy
 
PDF
Review unknown code with static analysis php ipc 2018
Damien Seguy
 
PDF
Static analysis saved my code tonight
Damien Seguy
 
Strong typing @ php leeds
Damien Seguy
 
Strong typing : adoption, adaptation and organisation
Damien Seguy
 
Qui a laissé son mot de passe dans le code
Damien Seguy
 
Analyse statique et applications
Damien Seguy
 
Top 10 pieges php afup limoges
Damien Seguy
 
Top 10 php classic traps DPC 2020
Damien Seguy
 
Meilleur du typage fort (AFUP Day, 2020)
Damien Seguy
 
Top 10 php classic traps confoo
Damien Seguy
 
Tout pour se préparer à PHP 7.4
Damien Seguy
 
Top 10 php classic traps php serbia
Damien Seguy
 
Top 10 php classic traps
Damien Seguy
 
Top 10 chausse trappes
Damien Seguy
 
Code review workshop
Damien Seguy
 
Understanding static analysis php amsterdam 2018
Damien Seguy
 
Review unknown code with static analysis php ce 2018
Damien Seguy
 
Everything new with PHP 7.3
Damien Seguy
 
Php 7.3 et ses RFC (AFUP Toulouse)
Damien Seguy
 
Tout sur PHP 7.3 et ses RFC
Damien Seguy
 
Review unknown code with static analysis php ipc 2018
Damien Seguy
 
Static analysis saved my code tonight
Damien Seguy
 
Ad

Recently uploaded (20)

PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
July Patch Tuesday
Ivanti
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 

Code review for busy people