.. _structures-doubleinstruction: .. _double-instructions: Double Instructions +++++++++++++++++++ Twice the same call in a row. This might be a typo, and the second call is useless. It may also be an non-idempotent method: that is, a method which has a different `result `_ when called with the same arguments. For example, ``rand()`` or ``fgets()``. .. code-block:: php Connex PHP features ------------------- + `idempotent `_ Suggestions ___________ * Remove double work * Avoid repetition by using loops, variadic or quantifiers `(dirname($path, 2))` Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/DoubleInstruction | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Instant (5 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+