rspec/rules/S1121/description.adoc
Peter Trifanov d953a8c265
Modify S1121: Migrate to LayC - Assignments should not be made from within sub-expressions
Co-authored-by: Fred Tingaud <frederic.tingaud@sonarsource.com>
2023-10-13 19:17:01 +02:00

5 lines
395 B
Plaintext

A common code smell that can hinder the clarity of source code is making assignments within sub-expressions.
This practice involves assigning a value to a variable inside a larger expression, such as within a loop or a conditional statement.
This practice essentially gives a side-effect to a larger expression, thus making it less readable. This often leads to confusion and potential errors.