SlideShare a Scribd company logo
@danaluther
How to analyze your codebase
with Exakat using Docker
Static analysis for everyone
https://joind.in/talk/b32c9
@danaluther
Static Analysis
What is it and why do we need it?
@danaluther
Static Analysis
What is it and why do we need it?
• Dynamic Analysis - Performed while the program is running
@danaluther
Static Analysis
What is it and why do we need it?
• Dynamic Analysis - Performed while the program is running
• Unit / Functional / Acceptance Tests
@danaluther
Static Analysis
What is it and why do we need it?
• Dynamic Analysis - Performed while the program is running
• Unit / Functional / Acceptance Tests
• Static Analysis - Performed before running the program
@danaluther
Static Analysis
What is it and why do we need it?
• Dynamic Analysis - Performed while the program is running
• Unit / Functional / Acceptance Tests
• Static Analysis - Performed before running the program
• Analyze as part of the development cycle before unit tests are run
@danaluther
Static Analysis
What is it and why do we need it?
• Dynamic Analysis - Performed while the program is running
• Unit / Functional / Acceptance Tests
• Static Analysis - Performed before running the program
• Analyze as part of the development cycle before unit tests are run
• Can catch errors and vulnerabilities that may be overlooked by Unit Tests
@danaluther
Static Analysis
What is it and why do we need it?
• Dynamic Analysis - Performed while the program is running
• Unit / Functional / Acceptance Tests
• Static Analysis - Performed before running the program
• Analyze as part of the development cycle before unit tests are run
• Can catch errors and vulnerabilities that may be overlooked by Unit Tests
• Identify patterns in the code
@danaluther
Popular Options for Static Analysis
Standalone and Integrated Options
• Exakat - https://www.exakat.io/en/

• PHPStan - https://phpstan.org/

• Psalm - https://psalm.dev/

• PHP_CodeSni
ff
er - https://github.com/squizlabs/PHP_CodeSni
ff
er

• PhpStorm Inspections - https://www.jetbrains.com/help/phpstorm/code-
inspection.html
@danaluther
@danaluther
Take it with a grain of salt…
function ex_mysql_unbuffered_query($query, $dbh)


{


if (!$this
-
>
use_mysqli)


{


	
return mysql_unbuffered_query($query, $dbh);


	
}


return mysqli_query($dbh, $query, MYSQLI_USE_RESULT);


}
@danaluther
Why Exakat?
Community version with multiple report options
https://github.com/exakat/exakat
@danaluther
Why Exakat?
Community version with multiple report options
• Analyze once, generate multiple reports
https://github.com/exakat/exakat
@danaluther
Why Exakat?
Community version with multiple report options
• Analyze once, generate multiple reports
• Multiple PHP version compatibility reports
https://github.com/exakat/exakat
@danaluther
Why Exakat?
Community version with multiple report options
• Analyze once, generate multiple reports
• Multiple PHP version compatibility reports
• Option for visual representation of the analysis
https://github.com/exakat/exakat
@danaluther
Why Exakat?
Community version with multiple report options
• Analyze once, generate multiple reports
• Multiple PHP version compatibility reports
• Option for visual representation of the analysis
• Option for customized reports
https://github.com/exakat/exakat
@danaluther
Damien Seguy
@faguo
• https://www.exakat.io/en/bonjour/

• All the elePHPants
@danaluther
Why Docker?
No additional local code installation required!
• Exakat o
ffi
cial image requires no lengthy local install.

• Exakat public repo allows for quickly generating the latest versions.
@danaluther
Get the Exakat Docker image
https://hub.docker.com/r/exakat/exakat
> docker image pull exakat/exakat
@danaluther
Confirm the docker container runs
> docker container run
-
-
rm exakat/exakat exakat version
@danaluther
Confirm the configuration options
> docker container run
-
-
rm exakat/exakat exakat doctor
@danaluther
Time to Analyze!
https://github.com/DanaLuther/yii2-swivel
@danaluther
Create Project Report Docker Volume
Create the local directory that you want to store your project
fi
les in
> mkdir
-
p /Users/danaluther/Repos/exakat_y2s
@danaluther
Create Project Report Docker Volume
Create a docker volume that points to the directory which was just created
> docker volume create exakat_y2s 


-
-
opt type=none
-
-
opt o=bind 


-
-
opt device=/Users/danaluther/Repos/exakat_y2s
@danaluther
Create Project Report Docker Volume
Con
fi
rm the volume was created properly
> docker volume inspect exakat_y2s
@danaluther
Customize exakat ini
https://exakat.readthedocs.io/en/latest/User/Con
fi
guration.html
• Command line options

• The .exakat.ini
fi
le at source code root

• The con
fi
g.ini
fi
le in the project directory

• The exakat.ini
fi
le in the con
fi
g directory

• Default values within the code (.exakat.yaml)
@danaluther
Command line options
https://exakat.readthedocs.io/en/latest/Administrator/Commands.html
@danaluther
Command line options
https://exakat.readthedocs.io/en/latest/Administrator/Commands.html
@danaluther
config.ini - Available Options
https://exakat.readthedocs.io/en/latest/User/Con
fi
guration.html
@danaluther
exakat.ini
https://github.com/exakat/exakat-docker/blob/master/con
fi
g/exakat.ini
@danaluther
.exakat.yaml
https://exakat.readthedocs.io/en/latest/User/Con
fi
guration.html
@danaluther
Additional configuration options
https://exakat.readthedocs.io/en/latest/User/Con
fi
guration.html
@danaluther
Run Exakat init
exakat init -p <your project name> -R <path/to/the/code> -copy
> docker container run
-
-
rm 


-
v exakat_y2s:/usr/src/exakat/projects 


-
v $(PWD):/usr/src/exakat/projects/volume_src 


exakat/exakat exakat init 


-
p Yii2Swivel
-
v 


-R /usr/src/exakat/projects/volume_src/
-
copy
@danaluther
@danaluther
Verify Initialization in the Exakat folder
@danaluther
Run Exakat project
From the project source directory
> docker container run
-
-
rm 


-
v exakat_y2s:/usr/src/exakat/projects 


-
v $(PWD):/usr/src/exakat/projects/volume_src 


exakat/exakat exakat project
-
p Yii2Swivel
-
v
@danaluther
View Generated Report
Files have been generated in our permanent exakat_y2s folder
@danaluther
@danaluther
@danaluther
Compatibility Report
PHP Version Compatibility Analysis
@danaluther
Compatibility Report
PHP Version Compatibility Analysis
@danaluther
@danaluther
@danaluther
@danaluther
@danaluther
@danaluther
@danaluther
Fixes
php-cs-
fi
xer
@danaluther
Fixes
Rector
@danaluther
Inventories
appinfo()
@danaluther
Inventories
appinfo()
@danaluther
Dead Code report
… taken with a grain of salt
@danaluther
Dead Code report
… taken with a grain of salt
@danaluther
@danaluther
Dead Code report
… taken with a grain of salt
@danaluther
Dead Code report
… taken with a grain of salt
@danaluther
Dead Code report
… taken with a grain of salt
@danaluther
Customize reports
https://exakat.readthedocs.io/en/latest/Administrator/Commands.html#report
> docker container run
-
-
rm 


-
v exakat_y2s:/usr/src/exakat/projects 


-
v $(PWD):/usr/src/exakat/projects/volume_src 


exakat/exakat exakat report
-
p Yii2Swivel 


-
format Codesniffer
-
v
@danaluther
@danaluther
Customize reports
Dependency Wheel Report
> docker container run
-
-
rm 


-
v exakat_y2s:/usr/src/exakat/projects 


-
v $(PWD):/usr/src/exakat/projects/volume_src 


exakat/exakat exakat report
-
p Yii2Swivel 


-
format DependencyWheel
-
v
@danaluther
@danaluther
@danaluther
@danaluther
Customize reports
Dependency Wheel Report
> docker container run
-
-
rm 


-
v exakat_y2s:/usr/src/exakat/projects 


-
v $(PWD):/usr/src/exakat/projects/volume_src 


exakat/exakat exakat report
-
p Yii2Swivel 


-
format owasp
-
v
@danaluther
@danaluther
@danaluther
Persistent Report Directory
Reports stored in their unique folders by default
@danaluther
Customize reports
Migration80
> docker container run
-
-
rm 


-
v exakat_y2s:/usr/src/exakat/projects 


-
v $(PWD):/usr/src/exakat/projects/volume_src 


exakat/exakat exakat report
-
p Yii2Swivel 


-
format Migration80
-
v
@danaluther
@danaluther
@danaluther
@danaluther
@danaluther
@danaluther
Migration80 Output
Suggestions - Detail
@danaluther
Other output options?
Yes! There are many, many options to choose from.
• https://exakat.readthedocs.io/en/latest/Reference/Reports.html#list-of-
reports
@danaluther
Exakat for GitHub Actions
https://hub.docker.com/r/exakat/exakat-ga
@danaluther
Upcoming Exakat Features
Cobbler - https://exakat.readthedocs.io/en/latest/User/Cobbler.html
@danaluther
Questions??
Ask now or tweet at me if you think of it later!
https://www.linkedin.com/in/danaluther
dluther@envisageinternational.com
https://joind.in/talk/b32c9
🤔
?
? ?
?

More Related Content

PDF
Magento 2 performance profiling and best practices
PDF
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
PDF
Laravel and Django and Rails, Oh My!
PDF
Software Design Patterns in Laravel by Phill Sparks
PDF
External Master Data in Alfresco: Integrating and Keeping Metadata Consistent...
PDF
Maven - Taming the Beast
ODP
2017 DevSecCon ZAP Scripting Workshop
PDF
All the Laravel things: up and running to making $$
Magento 2 performance profiling and best practices
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
Laravel and Django and Rails, Oh My!
Software Design Patterns in Laravel by Phill Sparks
External Master Data in Alfresco: Integrating and Keeping Metadata Consistent...
Maven - Taming the Beast
2017 DevSecCon ZAP Scripting Workshop
All the Laravel things: up and running to making $$

What's hot (20)

KEY
HTML5 History & Features
PDF
Your First Scala Web Application using Play 2.1
PDF
JUC Europe 2015: Jenkins-Based Continuous Integration for Heterogeneous Hardw...
PDF
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
PPT
Sbt, idea and eclipse
PPTX
Building Apis in Scala with Playframework2
PPTX
All the support you need. Support libs in Android
ZIP
Drupal Deployment
PPTX
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
PDF
JUC Europe 2015: Scaling of Jenkins Pipeline Creation and Maintenance
PPTX
Test automation with Cucumber-JVM
PPTX
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
PDF
Developing modern java web applications with java ee 7 and angular js
PDF
Mixing Plone and Django for explosive results
PDF
Xtext beyond the defaults - how to tackle performance problems
KEY
HTML5: It goes to ELEVEN
PDF
JUC Europe 2015: Optimizing Your CI: Lessons Learned from a Successful Jenkin...
PDF
Leveraging a distributed architecture to your advantage
PDF
High Performance Solution for PHP7
HTML5 History & Features
Your First Scala Web Application using Play 2.1
JUC Europe 2015: Jenkins-Based Continuous Integration for Heterogeneous Hardw...
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
Sbt, idea and eclipse
Building Apis in Scala with Playframework2
All the support you need. Support libs in Android
Drupal Deployment
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
JUC Europe 2015: Scaling of Jenkins Pipeline Creation and Maintenance
Test automation with Cucumber-JVM
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
Developing modern java web applications with java ee 7 and angular js
Mixing Plone and Django for explosive results
Xtext beyond the defaults - how to tackle performance problems
HTML5: It goes to ELEVEN
JUC Europe 2015: Optimizing Your CI: Lessons Learned from a Successful Jenkin...
Leveraging a distributed architecture to your advantage
High Performance Solution for PHP7
Ad

Similar to How to analyze your codebase with Exakat using Docker - Longhorn PHP (20)

PDF
Static analysis saved my code tonight
PDF
Review unknown code with static analysis Zend con 2017
PDF
Review unknown code with static analysis php ce 2018
PPTX
Reducing Bugs With Static Code Analysis php tek 2025
PDF
Code review for busy people
PDF
Review unknown code with static analysis
PDF
Static and Dynamic Analysis at Ning
PDF
Review unknown code with static analysis php ipc 2018
PDF
Preparing code for Php 7 workshop
PDF
Php 7 compliance workshop singapore
PDF
Code review workshop
PDF
PHP Static Code Review
PDF
Preparing for the next php version
PDF
Last train to php 7
PPTX
Static Code Analysis PHP[tek] 2023
PDF
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PPTX
DDD (Debugger Driven Development)
PDF
Php 7.2 compliance workshop php benelux
POTX
eXplain – Systematical Analysis of IBM Legacy Code
PDF
Dynamic PHP web-application analysis
Static analysis saved my code tonight
Review unknown code with static analysis Zend con 2017
Review unknown code with static analysis php ce 2018
Reducing Bugs With Static Code Analysis php tek 2025
Code review for busy people
Review unknown code with static analysis
Static and Dynamic Analysis at Ning
Review unknown code with static analysis php ipc 2018
Preparing code for Php 7 workshop
Php 7 compliance workshop singapore
Code review workshop
PHP Static Code Review
Preparing for the next php version
Last train to php 7
Static Code Analysis PHP[tek] 2023
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
DDD (Debugger Driven Development)
Php 7.2 compliance workshop php benelux
eXplain – Systematical Analysis of IBM Legacy Code
Dynamic PHP web-application analysis
Ad

More from Dana Luther (14)

PDF
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdf
PDF
Enums In the Wild at PHP[tek] Conference 2025
PDF
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
PDF
Keep it Secret, Keep it Safe - Docker Secrets and DI
PDF
Integrated Feature Management - Using Feature Flags - PHPSerbia
PDF
Integrated Feature Management - Using Feature Flags - MidwestPHP
PDF
Integrated Feature Management - Using Feature Flags - SunshinePHP
PDF
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
PDF
Hands on Docker - Launch your own LEMP or LAMP stack
PDF
Converting Your Dev Environment to a Docker Stack - php[world]
PDF
Converting Your Dev Environment to a Docker Stack - Cascadia
PDF
Converting your DEV Environment to a Docker Stack - ZCOE18
PDF
Converting Your DEV Environment to a Docker Stack
PDF
Code Coverage for Total Security in Application Migrations
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdf
Enums In the Wild at PHP[tek] Conference 2025
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Keep it Secret, Keep it Safe - Docker Secrets and DI
Integrated Feature Management - Using Feature Flags - PHPSerbia
Integrated Feature Management - Using Feature Flags - MidwestPHP
Integrated Feature Management - Using Feature Flags - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting your DEV Environment to a Docker Stack - ZCOE18
Converting Your DEV Environment to a Docker Stack
Code Coverage for Total Security in Application Migrations

Recently uploaded (20)

PDF
Introduction to the IoT system, how the IoT system works
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
Digital Literacy And Online Safety on internet
PPTX
Funds Management Learning Material for Beg
PDF
Testing WebRTC applications at scale.pdf
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
Introduction to Information and Communication Technology
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Introduction to the IoT system, how the IoT system works
Introuction about ICD -10 and ICD-11 PPT.pptx
SAP Ariba Sourcing PPT for learning material
Digital Literacy And Online Safety on internet
Funds Management Learning Material for Beg
Testing WebRTC applications at scale.pdf
presentation_pfe-universite-molay-seltan.pptx
introduction about ICD -10 & ICD-11 ppt.pptx
tcp ip networks nd ip layering assotred slides
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
An introduction to the IFRS (ISSB) Stndards.pdf
RPKI Status Update, presented by Makito Lay at IDNOG 10
WebRTC in SignalWire - troubleshooting media negotiation
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
Introduction to Information and Communication Technology
Cloud-Scale Log Monitoring _ Datadog.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...

How to analyze your codebase with Exakat using Docker - Longhorn PHP