
Co-authored-by: Balázs Benics <108414871+balazs-benics-sonarsource@users.noreply.github.com>
16 lines
603 B
Plaintext
16 lines
603 B
Plaintext
|
|
When writing code, it is important to ensure that each statement serves a purpose and
|
|
contributes to the overall functionality of the program. When they have no side effects or do not change the control flow, they can either indicate a programming error or be redundant:
|
|
|
|
1. The code does not behave as intended: The statements are
|
|
expected to have an effect but they do not. This can be
|
|
caused by mistyping, copy-and-paste errors, etc.
|
|
|
|
2. The statements are residual after a refactoring.
|
|
|
|
=== Exceptions
|
|
|
|
The rule does not raise an issue:
|
|
|
|
* Statements containing only a semicolon (``++;++``)
|