You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PVS Studio is famous for its checks for copy/paste errors.
For example, there is a chance of writing this kind of code:
$x[0] = $v0;
$x[0] = $v1;
Or this:
$x[0] = $v0;
$x[1] = $v0;
It could be intermixed with something else:
// Questionable case: if unrelated() call can affect $x or $v variables,// we should not report this code;// but if unrelated() is pure, it should be safe?$x[0] = $v0;
unrelated();
$x[1] = $v0;
Also bad:
$x[0] = $y;
$x[0] = $y;
We detect some cases with "unused" variable check. But it's worthwhile to verify that we don't miss some of these cases.
There are pitfalls that should be considered here to avoid false positives:
RHS should probably be pure
RHS (and LHS) should probably not contain the previously assigned value
and so on
These blocks should be analysed as "windows" of somewhat fixed size.
The text was updated successfully, but these errors were encountered:
quasilyte
changed the title
Find suspicious duplicated statements
Find suspicious duplicated assignments
Apr 19, 2021
PVS Studio is famous for its checks for copy/paste errors.
For example, there is a chance of writing this kind of code:
Or this:
It could be intermixed with something else:
Also bad:
We detect some cases with "unused" variable check. But it's worthwhile to verify that we don't miss some of these cases.
There are pitfalls that should be considered here to avoid false positives:
These blocks should be analysed as "windows" of somewhat fixed size.
The text was updated successfully, but these errors were encountered: