Skip to content

Commit

Permalink
Fixing bugs related to quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
christopheexakat committed Dec 4, 2023
1 parent dde3747 commit cfb1b3b
Show file tree
Hide file tree
Showing 7 changed files with 345 additions and 97 deletions.
4 changes: 4 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Here is the release note of exakat.
+ New analysis : report short assignations on appends (should not be possible)
+ Updated analysis : report usage of static properties with ??= and other short assignations
+ New analysis : added support for the friend attribute
+ New analysis : report method names starting with __
+ New analysis : report $array[count($array)] append system
+ Updated analysis : unknown directive names cover more PHP functions and combinaisons
+ New analysis : report when void is returned by reference in a method

+ Tokenizer
+ Fixed bug with short assignment left operand not being marked as read as well as written
Expand Down
345 changes: 270 additions & 75 deletions Reference/Rules.rst

Large diffs are not rendered by default.

47 changes: 32 additions & 15 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 1610 rules to detect BUGS, CODE SMELLS, SECURITY OR QUALITY ISSUES in your PHP code.
Exakat provides unique 1614 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 @@ -130,7 +130,7 @@ All

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

Total : 1608 analysis
Total : 1612 analysis

* :ref:`adding-zero`
* :ref:`ambiguous-array-index`
Expand Down Expand Up @@ -1740,6 +1740,10 @@ Total : 1608 analysis
* :ref:`trait-is-not-a-type`
* :ref:`cannot-use-append-for-reading`
* :ref:`friend-attribute`
* :ref:`count()-to-array-append`
* :ref:`structures-uselesstrailingcomma`
* :ref:`reserved-methods`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -1758,7 +1762,7 @@ Analyze

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

Total : 485 analysis
Total : 486 analysis

* :ref:`adding-zero`
* :ref:`ambiguous-array-index`
Expand Down Expand Up @@ -2245,6 +2249,7 @@ Total : 485 analysis
* :ref:`static-methods-cannot-call-non-static-methods`
* :ref:`trait-is-not-a-type`
* :ref:`cannot-use-append-for-reading`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand Down Expand Up @@ -3800,7 +3805,7 @@ CompatibilityPHP53

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

Total : 95 analysis
Total : 96 analysis

* :ref:`non-static-methods-called-in-a-static`
* :ref:`ext-dba`
Expand Down Expand Up @@ -3897,6 +3902,7 @@ Total : 95 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -3917,7 +3923,7 @@ CompatibilityPHP54

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

Total : 92 analysis
Total : 93 analysis

* :ref:`non-static-methods-called-in-a-static`
* :ref:`use-lower-case-for-parent,-static-and-self`
Expand Down Expand Up @@ -4011,6 +4017,7 @@ Total : 92 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4031,7 +4038,7 @@ CompatibilityPHP55

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

Total : 85 analysis
Total : 86 analysis

* :ref:`non-static-methods-called-in-a-static`
* :ref:`ext-apc`
Expand Down Expand Up @@ -4118,6 +4125,7 @@ Total : 85 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4138,7 +4146,7 @@ CompatibilityPHP56

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

Total : 75 analysis
Total : 76 analysis

* :ref:`non-static-methods-called-in-a-static`
* :ref:`malformed-octal`
Expand Down Expand Up @@ -4215,6 +4223,7 @@ Total : 75 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4235,7 +4244,7 @@ CompatibilityPHP70

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

Total : 66 analysis
Total : 67 analysis

* :ref:`mcrypt\_create\_iv()-with-default-values`
* :ref:`magic-visibility`
Expand Down Expand Up @@ -4303,6 +4312,7 @@ Total : 66 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4323,7 +4333,7 @@ CompatibilityPHP71

This ruleset centralizes all analysis for the migration from PHP 7.0 to 7.1.

Total : 56 analysis
Total : 57 analysis

* :ref:`ext-mcrypt`
* :ref:`hash-algorithms-incompatible-with-php-5.3`
Expand Down Expand Up @@ -4381,6 +4391,7 @@ Total : 56 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4401,7 +4412,7 @@ CompatibilityPHP72

This ruleset centralizes all analysis for the migration from PHP 7.1 to 7.2.

Total : 49 analysis
Total : 50 analysis

* :ref:`undefined-constants`
* :ref:`hash-algorithms-incompatible-with-php-5.3`
Expand Down Expand Up @@ -4452,6 +4463,7 @@ Total : 49 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4472,7 +4484,7 @@ CompatibilityPHP73

This ruleset centralizes all analysis for the migration from PHP 7.2 to 7.3.

Total : 40 analysis
Total : 41 analysis

* :ref:`new-functions-in-php-7.3`
* :ref:`unknown-pcre2-option`
Expand Down Expand Up @@ -4514,6 +4526,7 @@ Total : 40 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4534,7 +4547,7 @@ CompatibilityPHP74

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

Total : 52 analysis
Total : 53 analysis

* :ref:`detect-current-class`
* :ref:`don't-read-and-write-in-one-expression`
Expand Down Expand Up @@ -4588,6 +4601,7 @@ Total : 52 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4608,7 +4622,7 @@ CompatibilityPHP80

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

Total : 42 analysis
Total : 43 analysis

* :ref:`old-style-constructor`
* :ref:`wrong-optional-parameter`
Expand Down Expand Up @@ -4652,6 +4666,7 @@ Total : 42 analysis
* :ref:`static-variable-can-default-to-arbitrary-expression`
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand All @@ -4672,7 +4687,7 @@ CompatibilityPHP81

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

Total : 31 analysis
Total : 32 analysis

* :ref:`php-7.4-removed-directives`
* :ref:`php-8.0-removed-directives`
Expand Down Expand Up @@ -4705,6 +4720,7 @@ Total : 31 analysis
* :ref:`final-traits-are-final`
* :ref:`typed-class-constants-usage`
* :ref:`static-variable-initialisation`
* :ref:`void-is-not-a-reference`

Specs
_____
Expand Down Expand Up @@ -5415,7 +5431,7 @@ Performances

This ruleset focuses on performances issues : anything that slows the code's execution.

Total : 59 analysis
Total : 60 analysis

* :ref:`eval()-usage`
* :ref:`for-using-functioncall`
Expand Down Expand Up @@ -5476,6 +5492,7 @@ Total : 59 analysis
* :ref:`should-cache-local`
* :ref:`recalled-condition`
* :ref:`could-use-yield-from`
* :ref:`count()-to-array-append`

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

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


1610 analyzers
1614 analyzers
-----------------------------

There are currently 1610 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 1614 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: 1610 analysis with faceted search
:alt: 1614 analysis with faceted search


Compatible with PHP 5.2 to 8.2
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 1610 rules to detect BUGS, CODE SMELLS, SECURITY OR QUALITY ISSUES in your PHP code.
Exakat provides unique 1614 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

0 comments on commit cfb1b3b

Please sign in to comment.