razielsd/phpSelenide

View on GitHub

Showing 128 of 128 total issues

Avoid using static access to class '\PHPUnit\Util\RegularExpression' in method 'matchElement'.
Open

        $state = RegularExpression::safeMatch($this->expected, $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

The method applyAssertNegative 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 using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionPositive'.
Open

        Assert::assertLessThanOrEqual(
            $this->expected,
            $actualSize,
            'Size must be less then or equal ' . $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 'assertCollectionPositive'.
Open

            Assert::assertEquals(
                $this->expected,
                $actualValue,
                $prefix . 'Not found attribute: ' . $this->attrName . ' with value ' .
                    $this->expected . '. Actual: ' . $actualValue
Severity: Minor
Found in lib/Selenide/Condition/Attribute.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::assertLessThanOrEqual(
            $this->expected,
            $actualSize,
            'Size must be less then or equal ' . $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::assertGreaterThan(
            $this->expected,
            $actualSize,
            'Size must be greater 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 'assertCollectionPositive'.
Open

            Assert::assertContains(
                $this->expected,
                $actualText,
                $prefix . 'Text not contain ' . $this->expected . ', actual - ' . $actualText
            );
Severity: Minor
Found in lib/Selenide/Condition/WithText.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 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 unused parameters such as '$text'.
Open

    public function selectOption($text)
Severity: Minor
Found in lib/Selenide/SelenideElement.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 '\WebDriver_Driver' in method 'connect'.
Open

        $driver = \WebDriver_Driver::factory(
            $this->selenide->configuration()->host, $this->selenide->configuration()->port, null
        );
Severity: Minor
Found in lib/Selenide/Driver.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::assertNotNull(
                $actualValue, $prefix . 'Not found attribute: ' . $this->attrName
            );
Severity: Minor
Found in lib/Selenide/Condition/Attribute.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::assertNotNull(
                $actualValue, $prefix . 'Not found attribute: ' . $this->attrName
            );
Severity: Minor
Found in lib/Selenide/Condition/Attribute.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(
            $actualSize > 0,
            'Element must be exists'
        );
Severity: Minor
Found in lib/Selenide/Condition/Exists.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 match 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('Condition ' . $this->getName() . " can't use in should()");
        }
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 using static access to class '\PHPUnit\Framework\Assert' in method 'assertCollectionNegative'.
Open

        Assert::assertNotEquals(
            $this->expected,
            $actualSize,
            'Size must be NOT equal ' . $this->expected . ', actual - ' . $actualSize
        );
Severity: Minor
Found in lib/Selenide/Condition/Size.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::assertLessThan(
            $this->expected,
            $actualSize,
            'Size must be less then or equal ' . $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 'assertCollectionPositive'.
Open

        Assert::assertGreaterThan(
            $this->expected,
            $actualSize,
            'Size must be greater 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,
                $actualText,
                $prefix . 'Found text: ' . $this->expected . '. Actual: ' . $actualText
            );
Severity: Minor
Found in lib/Selenide/Condition/Text.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::assertNotContains(
                $this->expected,
                $actualText,
                $prefix . 'Text contain ' . $this->expected . ', actual - ' . $actualText
            );
Severity: Minor
Found in lib/Selenide/Condition/WithText.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(
                $this->getActualValue($e),
                $prefix . 'Found child element: ' . $this->expected->asString()
            );
Severity: Minor
Found in lib/Selenide/Condition/Child.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

Severity
Category
Status
Source
Language