8. Rulesets

8.1. Presentation

Analysis are grouped in different rulesets, that may be run independantly. Each ruleset has a focus target,

Rulesets runs all its analysis and any needed dependency.

Rulesets are configured with the -T option, when running exakat in command line. For example :

php exakat.phar analyze -p <project> -T <Security>

8.2. List of rulesets

Here is the list of the current rulesets supported by Exakat Engine.

Name Description
Analyze Check for common best practices.
Dead code Check the unused code or unreachable code.
Suggestions List of possible modernisation of the PHP code.
CompatibilityPHP74 List features that are incompatible with PHP 7.4. It is known as php-src, work in progress.
CompatibilityPHP73 List features that are incompatible with PHP 7.3.
CompatibilityPHP72 List features that are incompatible with PHP 7.2.
CompatibilityPHP71 List features that are incompatible with PHP 7.1.
CompatibilityPHP80 Work in progress. The first rules are in, but far from finished
Performances Check the code for slow code.
Security Check the code for common security bad practices, especially in the Web environnement.
Top10 The most common issues found in the code
ClassReview A set of rules dedicate to class hygiene
LintButWontExec Check the code for common errors that will lead to a Fatal error on production, but lint fine.
CompatibilityPHP70 List features that are incompatible with PHP 7.0.
CompatibilityPHP56 List features that are incompatible with PHP 5.6.
CompatibilityPHP55 List features that are incompatible with PHP 5.5.
CompatibilityPHP54 List features that are incompatible with PHP 5.4.
CompatibilityPHP53 List features that are incompatible with PHP 5.3.
Coding Conventions List coding conventions violations.
Semantics Checks the meanings found the names of the code.
Typechecks Checks related to types.
Rector Suggests configuration to apply changes with Rector
php-cs-fixable Suggests configuration to apply changes with PHP-CS-FIXER

Note : in command line, don’t forget to add quotes to rulesets’ names that include white space.

8.3. Rulesets details

8.3.1. Analyze

This ruleset centralizes a large number of classic trap and pitfalls when writing PHP.

Total : 386 analysis

8.3.4. CompatibilityPHP53

This ruleset centralizes all analysis for the migration from PHP 5.2 to 5.3.

Total : 78 analysis

8.3.5. CompatibilityPHP54

This ruleset centralizes all analysis for the migration from PHP 5.3 to 5.4.

Total : 74 analysis

8.3.6. CompatibilityPHP55

This ruleset centralizes all analysis for the migration from PHP 5.4 to 5.5.

Total : 66 analysis

8.3.13. CompatibilityPHP80

This ruleset centralizes all analysis for the migration from PHP 7.4 to 8.0.

Total : 3 analysis

8.3.17. Rector

[Rector](https://github.com/rectorphp/rector) is a reconstructor tool. It applies modifications in the PHP code automatically. Exakat finds results which may be automatically updated with rector.

Total : 3 analysis

8.3.19. Semantics

This ruleset focuses on human interpretation of the code. It reviews special values of literals, and named structures.

Total : 9 analysis

8.3.20. Suggestions

This ruleset focuses on possibly better syntax than the one currently used. Those may be code modernization, alternatives, more efficient solutions, or simply left over from older versions.

Total : 86 analysis

8.3.23. php-cs-fixable

[PHP-CS-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) is a tool to automatically fix PHP Coding Standards issues. It applies modifications in the PHP code automatically. Exakat finds results which may be automatically updated with php-cs-fixer.

Total : 11 analysis