際際滷

際際滷Share a Scribd company logo
Nicola Pietroluongo @niklongstone
THE REVIEWER
CHECKLIST
How to be a better reviewer
Nicola Pietroluongo @niklongstone
 Im really good at stuff until people watch me
do that stuff.
-Nerd Anatomy
Nicola Pietroluongo @niklongstone
Nicola Pietroluongo
@niklongstone
 Lead developer/Solution architect
 Tech article writer
 Open Source contributor
 Author of Learning PHP7 by Packt Publishing
 +10y of PHP programming
 Amazon Alexa skill challenge award winner
Nicola Pietroluongo @niklongstone
Main areas
What we are going to cover
 Introduction to code review
 The checklist
 Tools and conclusions
Nicola Pietroluongo @niklongstone
1.
What code review is
Introduction to code review, things to do before
Nicola Pietroluongo @niklongstone
 Code review is systematic examination of
computer source code. It is intended to find
mistakes overlooked in the initial development
phase, improving the overall quality of team
and software.
-Wikipedia
Nicola Pietroluongo @niklongstone
TYPES OF CODE REVIEW
Nicola Pietroluongo @niklongstone
Formal
Inspection
/
Fagan
Inspection Meeting
http://www.mfagan.com/pdfs/software_pioneers.pdf
https://www.cs.umd.edu/class/spring2005/cmsc838p/VandV/fagan.pdf
OverviewPlanning Preparation Rework
Nicola Pietroluongo @niklongstone
Over-the-
shoulder
Nicola Pietroluongo @niklongstone
Pull
request
Nicola Pietroluongo @niklongstone
Pair
programming
Nicola Pietroluongo @niklongstone
FeedbackSpot the error Fix
TIME
Key points
Nicola Pietroluongo @niklongstone
Pair
Programming
TIME
Feedback
Spot the
error
Fix
Nicola Pietroluongo @niklongstone
GENERAL RULES
Nicola Pietroluongo @niklongstone
Share
Findings
Nicola Pietroluongo @niklongstone
 Time is money
-Your boss when youre late
Nicola Pietroluongo @niklongstone
Manage your time
Provide quick feedback
 Inspection rate 250 lines/hours
 Review 200-400 lines per review session
 Quick Feedback
Nicola Pietroluongo @niklongstone
Capture metrics
Define goals
 Lines Of Code
 Function Point
 Defect Density
 Risk Density
 Code Coverage
 Defect Detection Rate
 Defect Correction Rate
 Cyclomatic Complexity
Nicola Pietroluongo @niklongstone
Cyclomatic Complexity
Thomas J. McCabe, Sr. 1976
 E: Edges
 N: Nodes
 P: Number of exit points
(CC) = E - N + 2P
http://www.literateprogramming.com/mccabe.pdf
http://www.mccabe.com/pdf/More Complex Equals Less Secure-McCabe.pdf
A
B
C D
E
Nicola Pietroluongo @niklongstone
Cyclomatic Complexity
A>B
B==1
END IF
END IF
A=BB=0
7 Edges
6 Nodes
CC = 7- 6 + 2 = 3
T
TF
F
Nicola Pietroluongo @niklongstone
Its a Bug Hunt
NOT
a Blame Game
Nicola Pietroluongo @niklongstone
WHEN QUICKLY DECLINE
Nicola Pietroluongo @niklongstone
When
the pull request is out of scope
you should _______
When quickly decline?
Nicola Pietroluongo @niklongstone
When
the pull request is out of scope
you should DECLINE
When quickly decline?
Nicola Pietroluongo @niklongstone
When
the code has no test coverage
you should _______
When quickly decline?
Nicola Pietroluongo @niklongstone
When
the code has no test coverage
you should DECLINE
When quickly decline?
Nicola Pietroluongo @niklongstone
When
you dont like the solution provided
you should _______
When quickly decline?
Nicola Pietroluongo @niklongstone
When
you dont like the solution provided
you should _______
When quickly decline?
Nicola Pietroluongo @niklongstone
Production
Border
Force
Nicola Pietroluongo @niklongstone
2.
The checklist
Reviewers responsibilities
Nicola Pietroluongo @niklongstone
The checklist
What we will cover
 Best Practices
 Foundation
 Architecture
 Key Areas (Security, Logging, Performances)
Nicola Pietroluongo @niklongstone
BEST PRACTICES
Nicola Pietroluongo @niklongstone
 Fat model, skinny controller
-Weight Watchers
Nicola Pietroluongo @niklongstone
Services
config
# Sf 2.8 app/config/services.yml
services:
# keep your service names short
app.slugger:
class: AppBundleUtilsSlugger
# Sf 3.3 app/config/services.yml
services:
# use the fully-qualified class name as the service id
AppBundleUtilsSlugger:
public: false
Nicola Pietroluongo @niklongstone
Adopt whats make your teams life easier.
Best practices
Nicola Pietroluongo @niklongstone
Controller as a
Service
class EventController
{
//...
public function __construct(
TemplatingEngine $templating
Router $router,
LoggerInterface $logger,
EventRepository $eventRepository
)
//...
public function indexAction($id)
{
//...
Nicola Pietroluongo @niklongstone
FOUNDATION
Nicola Pietroluongo @niklongstone
Parameters/
Return Types
/**
* Get options.
*
* @param string $name
* @param mixed $value
*
* @return mixed $option
*/
public function getOption($name, $value)
{
//...
Nicola Pietroluongo @niklongstone
Dependency
Constraint
Nicola Pietroluongo @niklongstone
Alternatives/
Deprecations
Nicola Pietroluongo @niklongstone
TEST
Nicola Pietroluongo @niklongstone
ARCHITECTURE
Nicola Pietroluongo @niklongstone
 Never assume anything
-Law enforcement
Nicola Pietroluongo @niklongstone
 To bundle or not to bundle,
that is the question
-Sf Hamlet
Nicola Pietroluongo @niklongstone
Folder
structure
Nicola Pietroluongo @niklongstone
KEY AREAS
Nicola Pietroluongo @niklongstone
Security
CSRF token
# app/config/security.yml
security:
# ...
firewalls:
secured_area:
# ...
form_login:
# ...
csrf_token_generator: security.csrf.token_manager
# twig template
{# ... #}
<form action="{{ path('login') }}" method="post">
{# ... the login fields #}
<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
<button type="submit">login</button>
</form>
Nicola Pietroluongo @niklongstone
OWASP - Code Review Guide
https://www.owasp.org/index.php/Category:OWASP_Code_Review_Project
Nicola Pietroluongo @niklongstone
Syslog Message Severities
RFC 5424
Numerical Code Severity
0 Emergency: system is unusable
1 Alert: action must be taken immediately
2 Critical: critical conditions
3 Error: error conditions
4 Warning: warning conditions
5 Notice: normal but significant condition
6 Informational: informational messages
7 Debug: debug-level messages
Nicola Pietroluongo @niklongstone
Syslog Message Severities
RFC 5424
Numerical Code Severity
0 Emergency: system is unusable
1 Alert: action must be taken immediately
2 Critical: critical conditions
3 Error: error conditions
4 Warning: warning conditions
5 Notice: normal but significant condition
6 Informational: informational messages
7 Debug: debug-level messages
Nicola Pietroluongo @niklongstone
 I want it all, I want it now
-Queen
Nicola Pietroluongo @niklongstone
Website
Performance
source : Akamai.com
Nicola Pietroluongo @niklongstone
Loops
A)
for ($i = 0; $i < count($array); $i++) {
B)
$total = count($array);
for ($i = 0; $i < $total; $i++) {
Nicola Pietroluongo @niklongstone
3.
Tools
Tools and automation
Nicola Pietroluongo @niklongstone
Blackfire
Nicola Pietroluongo @niklongstone
SensioLabs
Insight
Nicola Pietroluongo @niklongstone
PHP CSF
Nicola Pietroluongo @niklongstone
Exakat
Nicola Pietroluongo @niklongstone
PhpMetrics
Nicola Pietroluongo @niklongstone
PHP MD
Nicola Pietroluongo @niklongstone
PHPMD
$ ./phpmd.phar filesOrDir reportFormat rules
$ ./phpmd.phar fileA.php,fileB.php text cleancode,codesize
Nicola Pietroluongo @niklongstone
Git diff
$ git diff --name-only --diff-filter=d master
src/CinemaBundle/Controller/CinemaController.php
src/CinemaBundle/Entity/Screening.php
src/CinemaBundle/Entity/ScreeningVenue.php
src/CinemaBundle/Entity/Showing.php
Nicola Pietroluongo @niklongstone
Sed
$ sed ':a; $!N; s/n/,/; ta'
:a creates a pattern
$!N appends lines to the pattern if not last line
s/n/,/ replaces new line with comma
ta repeat the a
Nicola Pietroluongo @niklongstone
Pull it together
*All in one line
./phpmd.phar
$(git diff --name-only --diff-filter=d master |
sed ':a; $!N; s/n/,/; ta')
text cleancode,codesize
Nicola Pietroluongo @niklongstone
 Automate, automate, automate.
Allright, allright, all right.
-Matthew McSymfony
Nicola Pietroluongo @niklongstone
LIGHT TOUCH REVIEW
Nicola Pietroluongo @niklongstone
Light touch review
Inspect whats critical
Automation
High code coverage
Small and contained release
Good knowledge of the project, business and practices
Nicola Pietroluongo @niklongstone
Thanks!!NicolaPietroluongo.com
@niklongstone
https://github.com/niklongstone
https://joind.in/talk/20dcd
Ad

Recommended

Deployments in one click!
Deployments in one click!
Manuel de la Pe単a Pe単a
The Blameless Cloud: Bringing Actionable Retrospectives to Salesforce
The Blameless Cloud: Bringing Actionable Retrospectives to Salesforce
J. Paul Reed
Achieving Technical Excellence in Your Software Teams - from Devternity
Achieving Technical Excellence in Your Software Teams - from Devternity
Peter Gfader
In graph we trust: Microservices, GraphQL and security challenges
In graph we trust: Microservices, GraphQL and security challenges
Mohammed A. Imran
Behat Best Practices with Symfony
Behat Best Practices with Symfony
CiaranMcNulty
API Platform and Symfony: a Framework for API-driven Projects
API Platform and Symfony: a Framework for API-driven Projects
Les-Tilleuls.coop
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
Ryan Weaver
A Journey from Hexagonal Architecture to Event Sourcing - SymfonyCon Cluj 2017
A Journey from Hexagonal Architecture to Event Sourcing - SymfonyCon Cluj 2017
Carlos Buenosvinos
Code reviews
Code reviews
Ra炭l Araya Tauler
Code Reviews @ Quatico
Code Reviews @ Quatico
Jan Wloka
Refactoring the third commandment
Refactoring the third commandment
Nicola Pietroluongo
Code Review
Code Review
Ravi Raj
Code Review
Code Review
rantav
How to successfully grow a code review culture
How to successfully grow a code review culture
Nina Zakharenko
Code review
Code review
dqpi
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0
The Linux Foundation
Pull requests do's and don'ts
Pull requests do's and don'ts
Arie Bregman
Code review best practice
Code review best practice
Oren Digmi
Best Practices in Software Development
Best Practices in Software Development
Andr辿 Pitombeira
How to successfully grow a code review culture
How to successfully grow a code review culture
Danylenko Max
FUG Agile software engineering practices
FUG Agile software engineering practices
Serena Software
You Live, You Learn, Then You Get Perforce Swarm
You Live, You Learn, Then You Get Perforce Swarm
Perforce
Documenting code yapceu2016
Documenting code yapceu2016
S淡ren Lund
Code Reviews
Code Reviews
phildenoncourt
Code review in practice
Code review in practice
Edorian
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
.NET Conf UY
The Anatomy of a Code Review
The Anatomy of a Code Review
Guilherme Garnier
From hello world to goodbye code
From hello world to goodbye code
Kim Moir
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools

More Related Content

Similar to The reviewer checklist (20)

Code reviews
Code reviews
Ra炭l Araya Tauler
Code Reviews @ Quatico
Code Reviews @ Quatico
Jan Wloka
Refactoring the third commandment
Refactoring the third commandment
Nicola Pietroluongo
Code Review
Code Review
Ravi Raj
Code Review
Code Review
rantav
How to successfully grow a code review culture
How to successfully grow a code review culture
Nina Zakharenko
Code review
Code review
dqpi
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0
The Linux Foundation
Pull requests do's and don'ts
Pull requests do's and don'ts
Arie Bregman
Code review best practice
Code review best practice
Oren Digmi
Best Practices in Software Development
Best Practices in Software Development
Andr辿 Pitombeira
How to successfully grow a code review culture
How to successfully grow a code review culture
Danylenko Max
FUG Agile software engineering practices
FUG Agile software engineering practices
Serena Software
You Live, You Learn, Then You Get Perforce Swarm
You Live, You Learn, Then You Get Perforce Swarm
Perforce
Documenting code yapceu2016
Documenting code yapceu2016
S淡ren Lund
Code Reviews
Code Reviews
phildenoncourt
Code review in practice
Code review in practice
Edorian
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
.NET Conf UY
The Anatomy of a Code Review
The Anatomy of a Code Review
Guilherme Garnier
From hello world to goodbye code
From hello world to goodbye code
Kim Moir
Code Reviews @ Quatico
Code Reviews @ Quatico
Jan Wloka
Refactoring the third commandment
Refactoring the third commandment
Nicola Pietroluongo
Code Review
Code Review
Ravi Raj
Code Review
Code Review
rantav
How to successfully grow a code review culture
How to successfully grow a code review culture
Nina Zakharenko
Code review
Code review
dqpi
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0
The Linux Foundation
Pull requests do's and don'ts
Pull requests do's and don'ts
Arie Bregman
Code review best practice
Code review best practice
Oren Digmi
Best Practices in Software Development
Best Practices in Software Development
Andr辿 Pitombeira
How to successfully grow a code review culture
How to successfully grow a code review culture
Danylenko Max
FUG Agile software engineering practices
FUG Agile software engineering practices
Serena Software
You Live, You Learn, Then You Get Perforce Swarm
You Live, You Learn, Then You Get Perforce Swarm
Perforce
Documenting code yapceu2016
Documenting code yapceu2016
S淡ren Lund
Code review in practice
Code review in practice
Edorian
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
.NET Conf UY
The Anatomy of a Code Review
The Anatomy of a Code Review
Guilherme Garnier
From hello world to goodbye code
From hello world to goodbye code
Kim Moir

Recently uploaded (20)

Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Philip Schwarz
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
Building Geospatial Data Warehouse for GIS by GIS with FME
Building Geospatial Data Warehouse for GIS by GIS with FME
Safe Software
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
Zonerankers Digital marketing solutions
Zonerankers Digital marketing solutions
reenashriee
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
Which Hiring Management Tools Offer the Best ROI?
Which Hiring Management Tools Offer the Best ROI?
HireME
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding as the Computational Dual of ...
Philip Schwarz
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
Building Geospatial Data Warehouse for GIS by GIS with FME
Building Geospatial Data Warehouse for GIS by GIS with FME
Safe Software
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
Zonerankers Digital marketing solutions
Zonerankers Digital marketing solutions
reenashriee
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
Simplify Insurance Regulations with Compliance Management Software
Simplify Insurance Regulations with Compliance Management Software
Insurance Tech Services
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
Why Every Growing Business Needs a Staff Augmentation Company IN USA.pdf
mary rojas
AI for PV: Development and Governance for a Regulated Industry
AI for PV: Development and Governance for a Regulated Industry
Biologit
Ad

The reviewer checklist

Editor's Notes

  • #3: I'd like to share a secret with you: I think code review is really boring thats why Ive created this talk. Before starting I have a little question for you Who likes code review? (show of hands)Who thinks that code review improves only software quality? We will see during the course of this session why I asked this question.
  • #33: most effective procedure to build clean and less complex web app
  • #35: appname.location.servicename to avoid collisions. We will see more examples of how the target has been adjusted based on the community considerations, based on the real usage of the framework.
  • #36: Its a little bit like the bubble wrap story. Bubble wrap invented in the 1957 was at the beginning advertised as wallpaper. Can you imagine you put your hand on the wall and pick pock. Then when IBM launched the 1401 computer bubble wrap was used for the shipping.
  • #38: about to review the core functionalities of classes and methods
  • #41: JsonDecode class
  • #42: about to review the core functionalities of classes and methods
  • #43: about to review the core functionalities of classes and methods
  • #47: about to review the core functionalities of classes and methods
  • #49: about to review the core functionalities of classes and methods
  • #50: Symfony comes with Monolog under the PSR-3 the Logger Interface that follows the log levels described by the RFC 5424 for the syslog protocol.
  • #63: In the review process you dont need to run a complete analysis of all your code base but only what is included in a pull request.