Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive on : Same Conditions In Condition #126

Open
philippechevieux opened this issue Oct 29, 2019 · 0 comments
Open

False positive on : Same Conditions In Condition #126

philippechevieux opened this issue Oct 29, 2019 · 0 comments

Comments

@philippechevieux
Copy link

Hello,
I've notice that "same conditions in condition" analyzer does not take in consideration if the value is updated.

Example :

if (empty($a)) {
    $a = getValue();

    if (empty($a)) {
        $a = getValueOtherFunction();
    }
}

I guess the proper way will be to do something like this :

if (empty($a)) {
    $a = getValue();
}
if (empty($a)) {
     $a = getValueOtherFunction();
}

Am i right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant