exakat 0.11.7 : long armed ape monkey.

Exakat 0.11.7 review

Exakat 0.11.7 review is out, right during the ‘Exakat Dutch tour June 2017‘. We’ll be in Amersfoort Tuesday 13rd, and Amsterdam for DPC on June 30th. This week’s version is loaded with new analysis, and you can expect even more coming up the next weeks. Support for new PHP extensions, reaching 140: gender and judy. A suggestion analysis that helps you factorize frequently used functions, and the first design pattern detectors, coming with the PSR Appinfo() report. And support for PHP 7.1.6 and 7.0.20 that were published last Thursday.

Support for gender and judy

Gender is an actual PHP extension that guesses the gender based on the first name of a person. It has over 40 000 names from 54 countries. This may be a handy database for customizing a welcome page.
Judy is an extension to that handle dynamic sparse array. Sparse arrays are large arrays with large range of unassigned indices. Judy is able to handle by only consuming memory when the indices are used.

Design patterns detectors

The Ambassador report now features PSR: PHP standard recommendations provides interfaces to structure Cache, links or HTTP messages interfaces. When a class in the code implements one of them, they are reported. See it for yourself on phpmyadmin.

Exakat reports PSR usage and Design Patterns
At the same time, the first Design pattern were added to the same report. Dependency injections are now reported. Other Design Pattern will be added in the coming versions.

Function factorization

Exakat reports functioncalls that are frequently made with the same arguments. For example, the code may use a lot of explode(‘,’, $xxx) or str_replace(‘&’, $c, $d), in various files.
Often, those functioncalls are a pre-processing, preparing data to be fed into a function, or an instantiation. Since they are frequently used, they are filling a recurrent need. It is wise to consider factorizing them in a helper function. This way, they are all linked by the same code, and easy to update.
This also helps make the code more readable, as the target of the function is now in its name, and not a guess away.
This suggestion brings more results as the code base grows: a small code base yields less repetitions, thus leading to fewer refactorisation possibilities. This may be linked to the DRY principle: don’t repeat yourself, and to the usage of constant in the code.

Support PHP 7.1.6 and 7.0.20 and PHP 7.2

Last Thursday, the PHP group released PHP 7.1.6 and 7.0.20. Those two minor versions provide 18 bug fixes to the current PHP versions, covering 7 extensions. Exakat was updated with all those bugs, and reports their impact in your code. You can see that those versions fixes a bug for PHPmyadmin users.

Exakat reports impact of minor version on the PHP code
On a related note, PHP 7.2 is about to get its development branch any moment, starting the long path toward release. As you may have noticed, Exakat already provides insights about migration toward this new middle version.

In the coming week, as the features are frozen, we’ll publish a full listing, to help you understand what makes this new version great.
In between, a new Compatibility PHP 7.3 theme was added: it is indeed early, as the next next version is not yet named. Never mind, we’ll rename them if needed, and until them, we’ll host there any implemented feature that won’t make it to PHP 7.2.

Happy PHP code reviews

Exakat 0.11.7 is opening more insights to the reports. Exakat covers bleeding edge PHP, both published (7.0.10, 7.1.6) and upcoming (7.2, 7.3?); it covers even more PHP extensions (judy and gender) and PSR; it is now opening new fields by reporting design patterns from the code. Static analysis is definitely the most dynamic field of PHP (pun intended).
All the 320+ analyzers are presented in the docs, including the hilarious ‘Variable used once in a context‘ which reports variables used only once within a method: it may be assigned ($x = 1;) or read (strtolower($y)), but why only once? Download Exakat on exakat.io, upgrade it with ‘exakat.phar upgrade -u’ and like us on github: .

Tweet about this on TwitterShare on RedditShare on LinkedInEmail this to someone