2. Rulesets

2.1. Introduction

Exakat provides unique 1383 rules to detect BUGS, CODE SMELLS, SECURITY OR QUALITY ISSUES in your PHP code.

For more smoothly usage, the ruleset concept allow you to run a set of rules based on a decidated focus. Beawre that a Ruleset run all the associated rules and any needed dependencies.

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

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

2.2. Summary

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

Name Description
Analyze Check for common best practices.
Attributes This ruleset gathers all rules that rely on PHP 8.0 attributes.
CE List of rules that are part of the Community Edition
CI-checks Quick check for common best practices.
ClassReview A set of rules dedicate to class hygiene
Coding conventions List coding conventions violations.
CompatibilityPHP53 List features that are incompatible with PHP 5.3.
CompatibilityPHP54 List features that are incompatible with PHP 5.4.
CompatibilityPHP55 List features that are incompatible with PHP 5.5.
CompatibilityPHP56 List features that are incompatible with PHP 5.6.
CompatibilityPHP70 List features that are incompatible with PHP 7.0.
CompatibilityPHP71 List features that are incompatible with PHP 7.1.
CompatibilityPHP72 List features that are incompatible with PHP 7.2.
CompatibilityPHP73 List features that are incompatible with PHP 7.3.
CompatibilityPHP74 List features that are incompatible with PHP 7.4.
CompatibilityPHP80 List features that are incompatible with PHP 8.0.
CompatibilityPHP81 List features that are incompatible with PHP 8.1.
Dead code Check the unused code or unreachable code.
LintButWontExec Check the code for common errors that will lead to a Fatal error on production, but lint fine.
Performances Check the code for slow code.
Rector Suggests configuration to apply changes with Rector
Security Check the code for common security bad practices, especially in the Web environnement.
Semantics Checks the meanings found the names of the code.
Suggestions List of possible modernisation of the PHP code.
Top10 The most common issues found in the code
Typechecks Checks related to types.
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.

2.3. List of rulesets

2.3.1. Analyze

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

Total : 425 analysis

2.3.2. Attributes

This ruleset gathers all rules that rely on PHP 8.0 attributes.

Total : 3 analysis

2.3.3. CE

This ruleset is the Community Edition list. It holds all the analysis that are in the community edition version of Exakat.

Total : 655 analysis

2.3.4. CI-checks

This ruleset is a collection of important rules to run in a CI pipeline.

Total : 178 analysis

2.3.5. ClassReview

This ruleset focuses on classes construction issues, and their related structures : traits, interfaces, methods, properties, constants.

Total : 56 analysis

2.3.6. Coding conventions

This ruleset centralizes all analysis related to coding conventions. Sometimes, those are easy to extract with static analysis, and so here they are. No all o them are available.

Total : 0 analysis

2.3.7. CompatibilityPHP53

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

Total : 80 analysis

2.3.8. CompatibilityPHP54

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

Total : 76 analysis

2.3.9. CompatibilityPHP55

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

Total : 68 analysis

2.3.10. CompatibilityPHP56

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

Total : 58 analysis

2.3.17. CompatibilityPHP81

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

Total : 7 analysis

2.3.21. Rector

RectorPHP 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

2.3.24. 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 : 100 analysis

2.3.27. 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