Skip to content

Commit

Permalink
version 2.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
christopheexakat committed Jul 20, 2022
1 parent d52d367 commit 4056237
Show file tree
Hide file tree
Showing 8 changed files with 340 additions and 79 deletions.
22 changes: 21 additions & 1 deletion Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Release Note

Here is the release note of exakat.

**Version 2.4.6 (???, 2022-07-21)**
**Version 2.4.7 (???, 2022-07-21)**


+ Architecture
Expand All @@ -24,6 +24,24 @@ Here is the release note of exakat.
+ Tokenizer
+

**Version 2.4.6 (???, 2022-07-21)**


+ Architecture
+

+ Cobbler
+ New cobbler : adds brackets to single-instruction commands

+ Report
+ Ambassador : refactored trait matrix

+ Analysis
+ Refactored analysis : Wrong Type Hint with First Class Callable

+ Tokenizer
+ Typed all internal atoms

**Version 2.4.5 (Li Yuanji, 2022-07-07)**


Expand Down Expand Up @@ -59,6 +77,8 @@ Here is the release note of exakat.
+ New analysis : If Then Return Favorite
+ Refactored analysis : Useless Casting checks % distinctly
+ Refactored analysis : Add Zero skips variables more often
+ New analysis : Could Be Resource
+ New analysis : DateTime Immutable is not immutable

+ Tokenizer
+ Fixed namespace's names dectection for older PHP versions
Expand Down
2 changes: 1 addition & 1 deletion Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Introduction
============

This is the documentation of the Exakat engine, version 2.4.5 (Build 1339), on Thu, 23 Jun 2022 04:53:54 +0000.
This is the documentation of the Exakat engine, version 2.4.5 (Build 1381), on Fri, 08 Jul 2022 10:36:02 +0000.

What is Exakat ?
----------------
Expand Down
58 changes: 58 additions & 0 deletions Reference/Cobblers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,64 @@ Cobblers are a complement to code analysis : the analysis spot code to be fixed,
List of Cobblers
--------------------------

.. _structures-addbracketstosingleinstructions:

.. _add-brackets-to-single-instructions:

Add Brackets To Single Instructions
+++++++++++++++++++++++++++++++++++
This cobbler adds curly brackets to single expression, with for(), foreach(), while(); and do...while() instructions.

No brackets are added to instructions that are already bracketed.

.. _add-brackets-to-single-instructions-before:

Before
______
.. code-block:: php
<?php
if ($a)
$b = 1;
else {
$c = ;2
}
?>
.. _add-brackets-to-single-instructions-after:

After
_____
.. code-block:: php
<?php
if ($a) {
$b = 1;
} else {
$c = ;2
}
?>
.. _add-brackets-to-single-instructions-specs:

Specs
_____

+----------------+--------------------------------------------+
| Short Name | Structures/AddBracketsToSingleInstructions |
+----------------+--------------------------------------------+
| Exakat version | 2.4.6 |
+----------------+--------------------------------------------+
| Available in | |
+----------------+--------------------------------------------+


.. _classes-addfinalclass:

.. _add-final-class:
Expand Down
292 changes: 227 additions & 65 deletions Reference/Rules.rst

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions Reference/Rulesets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Rulesets
Introduction
------------------------

Exakat provides unique 1504 rules to detect BUGS, CODE SMELLS, SECURITY OR QUALITY ISSUES in your PHP code.
Exakat provides unique 1506 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.

Expand Down Expand Up @@ -126,7 +126,7 @@ All

All is a dummy ruleset, which includes all the rules. It is mostly used internally.

Total : 1502 analysis
Total : 1504 analysis

* :ref:`adding-zero`
* :ref:`ambiguous-array-index`
Expand Down Expand Up @@ -1630,6 +1630,8 @@ Total : 1502 analysis
* :ref:`utf8-encode-and-decode-are-deprecated`
* :ref:`magic-method-returntype-is-restricted`
* :ref:`if-then-return-favorite`
* :ref:`typehints-couldberesource`
* :ref:`datetimeimmutable-is-not-immutable`

Specs
_____
Expand Down Expand Up @@ -4706,7 +4708,7 @@ IsExt

This is automatically filled, based on the documentation's isExt attribute.

Total : 30 analysis
Total : 31 analysis

* :ref:`static-methods-called-from-object`
* :ref:`undefined-constants`
Expand All @@ -4730,6 +4732,7 @@ Total : 30 analysis
* :ref:`php-native-reference-variable`
* :ref:`interfaces-is-not-implemented`
* :ref:`make-functioncall-with-reference`
* :ref:`dont-collect-void`
* :ref:`array\_map()-passes-by-value`
* :ref:`only-container-for-reference`
* :ref:`wrong-argument-name-with-php-function`
Expand All @@ -4756,7 +4759,7 @@ IsPHP

This is automatically filled, based on the documentation's isPHP attribute.

Total : 30 analysis
Total : 31 analysis

* :ref:`static-methods-called-from-object`
* :ref:`undefined-constants`
Expand All @@ -4780,6 +4783,7 @@ Total : 30 analysis
* :ref:`php-native-reference-variable`
* :ref:`interfaces-is-not-implemented`
* :ref:`make-functioncall-with-reference`
* :ref:`dont-collect-void`
* :ref:`array\_map()-passes-by-value`
* :ref:`only-container-for-reference`
* :ref:`wrong-argument-name-with-php-function`
Expand All @@ -4806,7 +4810,7 @@ IsStub

This is automatically filled, based on the documentation's isStub attribute.

Total : 28 analysis
Total : 29 analysis

* :ref:`static-methods-called-from-object`
* :ref:`undefined-constants`
Expand All @@ -4828,6 +4832,7 @@ Total : 28 analysis
* :ref:`php-native-reference-variable`
* :ref:`interfaces-is-not-implemented`
* :ref:`make-functioncall-with-reference`
* :ref:`dont-collect-void`
* :ref:`array\_map()-passes-by-value`
* :ref:`only-container-for-reference`
* :ref:`wrong-argument-name-with-php-function`
Expand All @@ -4854,7 +4859,7 @@ LintButWontExec

This ruleset focuses on PHP code that lint (php -l), but that will not run. As such, this ruleset tries to go further than PHP, by connecting files, just like during execution.

Total : 45 analysis
Total : 46 analysis

* :ref:`final-class-usage`
* :ref:`final-methods-usage`
Expand Down Expand Up @@ -4885,6 +4890,7 @@ Total : 45 analysis
* :ref:`typehint-must-be-returned`
* :ref:`clone-with-non-object`
* :ref:`trait-not-found`
* :ref:`wrong-type-returned`
* :ref:`interfaces-is-not-implemented`
* :ref:`can't-implement-traversable`
* :ref:`wrong-typed-property-default`
Expand Down Expand Up @@ -5492,7 +5498,7 @@ Typechecks
This ruleset focuses on typehinting. Missing typehints, or inconsistent typehint, are reported.
Total : 26 analysis
Total : 27 analysis
* :ref:`argument-should-be-typehinted`
* :ref:`useless-interfaces`
Expand Down Expand Up @@ -5520,6 +5526,7 @@ Total : 26 analysis
* :ref:`could-be-generator`
* :ref:`argument-could-be-iterable`
* :ref:`type-could-be-never`
* :ref:`typehints-couldberesource`
Specs
_____
Expand Down
8 changes: 4 additions & 4 deletions User/Overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Overview
Summary
-------

* `1504 analyzers`
* `1506 analyzers`
* `Compatible with PHP 5.2 to 8.0`_
* `Migration guide from 5.2 to 8.0`_
* `Modernize your code`_
Expand All @@ -18,15 +18,15 @@ Summary
* `Code visualizations`_


1504 analyzers
1506 analyzers
-----------------------------

There are currently 1504 different analyzers that check the PHP code to report code smells. Analyzers are inspired by PHP manual, migration documents, community good practices, computer science or simple logic.
There are currently 1506 different analyzers that check the PHP code to report code smells. Analyzers are inspired by PHP manual, migration documents, community good practices, computer science or simple logic.

Some of them track rare occurrences, and some are frequent. Some track careless mistakes and some are highly complex situations. In any case, exakat has your back, and will warn you.

.. image:: ../images/dashboard.748.png
:alt: 1504 analysis with faceted search
:alt: 1506 analysis with faceted search


Compatible with PHP 5.2 to 8.0
Expand Down
2 changes: 1 addition & 1 deletion User/Rule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Rule
Rules
----------------------------------

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

Each rule is documented with :
* a PHP version : The version of PHP to wich the rule apply
Expand Down
14 changes: 14 additions & 0 deletions User/Scoping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Php/Crc32MightBeNegative";
analyzer[] = "Php/CryptoUsage";
analyzer[] = "Php/DateFormats";
analyzer[] = "Php/DateTimeNotImmutable";
analyzer[] = "Php/DeclareEncoding";
analyzer[] = "Php/DeclareStrict";
analyzer[] = "Php/DeclareStrictType";
Expand Down Expand Up @@ -1573,6 +1574,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Typehints/CouldBeNever";
analyzer[] = "Typehints/CouldBeNull";
analyzer[] = "Typehints/CouldBeParent";
analyzer[] = "Typehints/CouldBeResource";
analyzer[] = "Typehints/CouldBeSelf";
analyzer[] = "Typehints/CouldBeString";
analyzer[] = "Typehints/CouldBeVoid";
Expand Down Expand Up @@ -2441,6 +2443,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Php/Crc32MightBeNegative'
- 'Php/CryptoUsage'
- 'Php/DateFormats'
- 'Php/DateTimeNotImmutable'
- 'Php/DeclareEncoding'
- 'Php/DeclareStrict'
- 'Php/DeclareStrictType'
Expand Down Expand Up @@ -3090,6 +3093,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Typehints/CouldBeNever'
- 'Typehints/CouldBeNull'
- 'Typehints/CouldBeParent'
- 'Typehints/CouldBeResource'
- 'Typehints/CouldBeSelf'
- 'Typehints/CouldBeString'
- 'Typehints/CouldBeVoid'
Expand Down Expand Up @@ -8958,6 +8962,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Complete/PhpNativeReference";
analyzer[] = "Constants/UndefinedConstants";
analyzer[] = "Enums/UndefinedEnumcase";
analyzer[] = "Functions/DontUseVoid";
analyzer[] = "Functions/OnlyVariablePassedByReference";
analyzer[] = "Functions/UndefinedFunctions";
analyzer[] = "Functions/WrongArgumentNameWithPhpFunction";
Expand Down Expand Up @@ -9001,6 +9006,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Complete/PhpNativeReference'
- 'Constants/UndefinedConstants'
- 'Enums/UndefinedEnumcase'
- 'Functions/DontUseVoid'
- 'Functions/OnlyVariablePassedByReference'
- 'Functions/UndefinedFunctions'
- 'Functions/WrongArgumentNameWithPhpFunction'
Expand Down Expand Up @@ -9051,6 +9057,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Complete/PhpNativeReference";
analyzer[] = "Constants/UndefinedConstants";
analyzer[] = "Enums/UndefinedEnumcase";
analyzer[] = "Functions/DontUseVoid";
analyzer[] = "Functions/OnlyVariablePassedByReference";
analyzer[] = "Functions/UndefinedFunctions";
analyzer[] = "Functions/WrongArgumentNameWithPhpFunction";
Expand Down Expand Up @@ -9094,6 +9101,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Complete/PhpNativeReference'
- 'Constants/UndefinedConstants'
- 'Enums/UndefinedEnumcase'
- 'Functions/DontUseVoid'
- 'Functions/OnlyVariablePassedByReference'
- 'Functions/UndefinedFunctions'
- 'Functions/WrongArgumentNameWithPhpFunction'
Expand Down Expand Up @@ -9144,6 +9152,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Complete/PhpNativeReference";
analyzer[] = "Constants/UndefinedConstants";
analyzer[] = "Enums/UndefinedEnumcase";
analyzer[] = "Functions/DontUseVoid";
analyzer[] = "Functions/OnlyVariablePassedByReference";
analyzer[] = "Functions/UndefinedFunctions";
analyzer[] = "Functions/WrongArgumentNameWithPhpFunction";
Expand Down Expand Up @@ -9185,6 +9194,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Complete/PhpNativeReference'
- 'Constants/UndefinedConstants'
- 'Enums/UndefinedEnumcase'
- 'Functions/DontUseVoid'
- 'Functions/OnlyVariablePassedByReference'
- 'Functions/UndefinedFunctions'
- 'Functions/WrongArgumentNameWithPhpFunction'
Expand Down Expand Up @@ -9244,6 +9254,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Functions/MustReturn";
analyzer[] = "Functions/OnlyVariableForReference";
analyzer[] = "Functions/TypehintMustBeReturned";
analyzer[] = "Functions/WrongReturnedType";
analyzer[] = "Interfaces/AvoidSelfInInterface";
analyzer[] = "Interfaces/CantImplementTraversable";
analyzer[] = "Interfaces/CantOverloadConstants";
Expand Down Expand Up @@ -9302,6 +9313,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Functions/MustReturn'
- 'Functions/OnlyVariableForReference'
- 'Functions/TypehintMustBeReturned'
- 'Functions/WrongReturnedType'
- 'Interfaces/AvoidSelfInInterface'
- 'Interfaces/CantImplementTraversable'
- 'Interfaces/CantOverloadConstants'
Expand Down Expand Up @@ -10410,6 +10422,7 @@ INI configuration for built-in rulesets. Copy them in config/rulesets.ini, and e
analyzer[] = "Typehints/CouldBeNever";
analyzer[] = "Typehints/CouldBeNull";
analyzer[] = "Typehints/CouldBeParent";
analyzer[] = "Typehints/CouldBeResource";
analyzer[] = "Typehints/CouldBeSelf";
analyzer[] = "Typehints/CouldBeString";
analyzer[] = "Typehints/CouldBeVoid";
Expand Down Expand Up @@ -10449,6 +10462,7 @@ YAML configuration for built-in rulesets. Copy them in your code, with the name
- 'Typehints/CouldBeNever'
- 'Typehints/CouldBeNull'
- 'Typehints/CouldBeParent'
- 'Typehints/CouldBeResource'
- 'Typehints/CouldBeSelf'
- 'Typehints/CouldBeString'
- 'Typehints/CouldBeVoid'
Expand Down

0 comments on commit 4056237

Please sign in to comment.