razielsd/phpSelenide

View on GitHub

Showing 128 of 128 total issues

The method applyAssert uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        }else {
            throw new Exception_UnsupportedConditionOperation(
                'Condition ' . $this->getName() . ' not support for assertion(shouldHave and etc)');
        }
Severity: Minor
Found in lib/Selenide/Condition/Rule.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$condition'.
Open

    public function beforeAssertNot(Condition_Rule $condition, string $locator)
Severity: Minor
Found in lib/Selenide/Listener.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$locator'.
Open

    public function beforeAssertNot(Condition_Rule $condition, string $locator)
Severity: Minor
Found in lib/Selenide/Listener.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionNegative'.
Open

            Assert::assertFalse(
                $element->enabled(),
                $prefix . 'Element is enabled'
            );
Severity: Minor
Found in lib/Selenide/Condition/Enabled.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method search uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                    } else {
                        return [];
                    }
Severity: Minor
Found in lib/Selenide/Driver.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$element'.
Open

    public function beforeSetValue(SelenideElement $element, $value, string $locator, string $textDescription)
Severity: Minor
Found in lib/Selenide/Listener.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionPositive'.
Open

            Assert::assertTrue(
                $element->enabled(),
                $prefix . 'Element is not enabled'
            );
Severity: Minor
Found in lib/Selenide/Condition/Enabled.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionPositive'.
Open

        Assert::assertLessThan(
            $this->expected,
            $actualSize,
            'Size must be less then ' . $this->expected . ', actual - ' . $actualSize
        );

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionNegative'.
Open

            Assert::assertNotEquals(
                $this->expected,
                $actual,
                'Value must be equal ' . $this->expected . ', actual - ' . $actual
            );
Severity: Minor
Found in lib/Selenide/Condition/Value.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionNegative'.
Open

            Assert::assertFalse(
                $element->isDisplayed(),
                $prefix . 'Element is visible'
            );
Severity: Minor
Found in lib/Selenide/Condition/Visible.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionPositive'.
Open

            Assert::assertTrue(
                $element->checked(),
                $prefix . 'Element is not checked'
            );
Severity: Minor
Found in lib/Selenide/Condition/Checked.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionNegative'.
Open

            Assert::assertNotRegExp(
                $this->expected,
                $actualText,
                $prefix . 'Text  matched regexp: ' . $this->expected . '. Actual: ' . $actualText
            );
Severity: Minor
Found in lib/Selenide/Condition/MatchText.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid unused parameters such as '$condition'.
Open

    public function beforeAssert(Condition_Rule $condition, string $locator)
Severity: Minor
Found in lib/Selenide/Listener.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionPositive'.
Open

            Assert::assertTrue(
                $element->isDisplayed(),
                $prefix . 'Element is not visible'
            );
Severity: Minor
Found in lib/Selenide/Condition/Visible.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method offsetSet uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->selectorList[$offset] = $value;
        }
Severity: Minor
Found in lib/Selenide/SelectorList.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$offset'.
Open

    public function offsetSet($offset, $value)
Severity: Minor
Found in lib/Selenide/ElementsCollection.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$value'.
Open

    public function offsetSet($offset, $value)
Severity: Minor
Found in lib/Selenide/ElementsCollection.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$textDescription'.
Open

    public function beforeSetValue(SelenideElement $element, $value, string $locator, string $textDescription)
Severity: Minor
Found in lib/Selenide/Listener.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionPositive'.
Open

            Assert::assertRegExp(
                $this->expected,
                $actualText,
                $prefix . 'Text not matched regexp: ' . $this->expected . '. Actual: ' . $actualText
            );
Severity: Minor
Found in lib/Selenide/Condition/MatchText.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid unused parameters such as '$locator'.
Open

    public function beforeClick(SelenideElement $element, string $locator, string $textDescription)
Severity: Minor
Found in lib/Selenide/Listener.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Severity
Category
Status
Source
Language