Skip to content

do while calculation #6

Open
Open
@bkdotcom

Description

@bkdotcom

sniff calculates this to be 7
codeclimate.com calculates it to be 5 (I think)
I think it should be 6 ??

public function doWhile()
{
    if (true) {         // 1
        $val = true    // 2
            ? 'foo'
            : 'bar';
    }
    do {                   //  nesting inc
        if (true) {        // 2
            break;
        }
    } while (false);    // 1
}

do {} while(); should have the same complexity as a while() {}

If we agree the value should be 6, I can add and new test to my PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions