YetiForceCompany/YetiForceCRM

View on GitHub
tests/GuiBase.php

Summary

Maintainability
A
2 hrs
Test Coverage

The method GuiBase::onNotSuccessfulTest() calls the typical debug function print_r() which is mostly only used during development.
Open

            \print_r($t);
Severity: Minor
Found in tests/GuiBase.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The method GuiBase::onNotSuccessfulTest() calls the typical debug function print_r() which is mostly only used during development.
Open

            \print_r($this->logs);
Severity: Minor
Found in tests/GuiBase.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

Function findError has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function findError(): void
    {
        $source = $this->driver->getPageSource();
        if (false !== stripos($source, 'YetiError!!!')) {
            // @codeCoverageIgnoreStart
Severity: Minor
Found in tests/GuiBase.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method findError has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function findError(): void
    {
        $source = $this->driver->getPageSource();
        if (false !== stripos($source, 'YetiError!!!')) {
            // @codeCoverageIgnoreStart
Severity: Minor
Found in tests/GuiBase.php - About 1 hr to fix

    Missing class import via use statement (line '154', column '15').
    Open

                    throw new \Exception('A JavaScript error has occurred: ' . PHP_EOL . $log);
    Severity: Minor
    Found in tests/GuiBase.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '141', column '14').
    Open

                throw new \Exception('Undefined variable found');
    Severity: Minor
    Found in tests/GuiBase.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '131', column '14').
    Open

                throw new \Exception('An error has been found');
    Severity: Minor
    Found in tests/GuiBase.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '136', column '14').
    Open

                throw new \Exception('An error has been found');
    Severity: Minor
    Found in tests/GuiBase.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Avoid using static access to class '\App\Config' in method 'url'.
    Open

            $this->driver->get(\App\Config::main('site_URL') . $url);
    Severity: Minor
    Found in tests/GuiBase.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 '\Facebook\WebDriver\WebDriverBy' in method 'login'.
    Open

            $this->driver->findElement(WebDriverBy::tagName('form'))->submit();
    Severity: Minor
    Found in tests/GuiBase.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 '\Facebook\WebDriver\Remote\RemoteWebDriver' in method 'setUp'.
    Open

                $this->driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities, 60000, 60000);
    Severity: Minor
    Found in tests/GuiBase.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 onNotSuccessfulTest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                echo 'No $this->driver';
            }
    Severity: Minor
    Found in tests/GuiBase.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 '\Facebook\WebDriver\WebDriverBy' in method 'login'.
    Open

            $this->driver->findElement(WebDriverBy::id('username'))->sendKeys('demo');
    Severity: Minor
    Found in tests/GuiBase.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 '\App\Config' in method 'login'.
    Open

            $this->driver->get(\App\Config::main('site_URL') . 'index.php?module=Users&view=Login');
    Severity: Minor
    Found in tests/GuiBase.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 '\Facebook\WebDriver\Remote\DesiredCapabilities' in method 'setUp'.
    Open

                $capabilities = DesiredCapabilities::chrome();
    Severity: Minor
    Found in tests/GuiBase.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 '\Facebook\WebDriver\WebDriverBy' in method 'login'.
    Open

            $this->driver->findElement(WebDriverBy::id('password'))->sendKeys(\Tests\Base\A_User::$defaultPassrowd);
    Severity: Minor
    Found in tests/GuiBase.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

    Define and throw a dedicated exception instead of using a generic one.
    Open

                throw new \Exception('An error has been found');
    Severity: Major
    Found in tests/GuiBase.php by sonar-php

    If you throw a general exception type, such as ErrorException, RuntimeException, or Exception in a library or framework, it forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle.

    Instead, either throw a subtype that already exists in the Standard PHP Library, or create your own type that derives from Exception.

    Noncompliant Code Example

    throw new Exception();  // Noncompliant
    

    Compliant Solution

    throw new InvalidArgumentException();
    // or
    throw new UnexpectedValueException();
    

    See

    Define and throw a dedicated exception instead of using a generic one.
    Open

                throw new \Exception('An error has been found');
    Severity: Major
    Found in tests/GuiBase.php by sonar-php

    If you throw a general exception type, such as ErrorException, RuntimeException, or Exception in a library or framework, it forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle.

    Instead, either throw a subtype that already exists in the Standard PHP Library, or create your own type that derives from Exception.

    Noncompliant Code Example

    throw new Exception();  // Noncompliant
    

    Compliant Solution

    throw new InvalidArgumentException();
    // or
    throw new UnexpectedValueException();
    

    See

    Define and throw a dedicated exception instead of using a generic one.
    Open

                    throw new \Exception('A JavaScript error has occurred: ' . PHP_EOL . $log);
    Severity: Major
    Found in tests/GuiBase.php by sonar-php

    If you throw a general exception type, such as ErrorException, RuntimeException, or Exception in a library or framework, it forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle.

    Instead, either throw a subtype that already exists in the Standard PHP Library, or create your own type that derives from Exception.

    Noncompliant Code Example

    throw new Exception();  // Noncompliant
    

    Compliant Solution

    throw new InvalidArgumentException();
    // or
    throw new UnexpectedValueException();
    

    See

    Define and throw a dedicated exception instead of using a generic one.
    Open

                throw new \Exception('Undefined variable found');
    Severity: Major
    Found in tests/GuiBase.php by sonar-php

    If you throw a general exception type, such as ErrorException, RuntimeException, or Exception in a library or framework, it forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle.

    Instead, either throw a subtype that already exists in the Standard PHP Library, or create your own type that derives from Exception.

    Noncompliant Code Example

    throw new Exception();  // Noncompliant
    

    Compliant Solution

    throw new InvalidArgumentException();
    // or
    throw new UnexpectedValueException();
    

    See

    Define a constant instead of duplicating this literal "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n" 3 times.
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Critical
    Found in tests/GuiBase.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Call to method get from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $this->driver->get(\App\Config::main('site_URL') . 'index.php?module=Users&view=Login');
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getCurrentURL from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                $this->driver->getCurrentURL();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method takeScreenshot from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                $this->driver->takeScreenshot(ROOT_DIRECTORY . '/cache/logs/selenium_screenshot.png');
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getTitle from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                $this->driver->getTitle();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method manage from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $browserLogs = $this->driver->manage()->getLog('browser');
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method tagName from undeclared class \Facebook\WebDriver\WebDriverBy
    Open

            $this->driver->findElement(WebDriverBy::tagName('form'))->submit();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getPageSource from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $source = $this->driver->getPageSource();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method create from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                $this->driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities, 60000, 60000);
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getPageSource from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                file_put_contents(ROOT_DIRECTORY . '/cache/logs/selenium_source.html', $this->driver->getPageSource());
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Reference to undeclared class \PHPUnit\Framework\TestCase
    Open

            parent::setUp();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getCurrentURL from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                'url' => $this->driver->getCurrentURL(),
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getPageSource from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                'getPageSource' => $this->driver->getPageSource(),
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method manage from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                print_r($this->driver->manage()->getLog('browser'));
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method id from undeclared class \Facebook\WebDriver\WebDriverBy
    Open

            $this->driver->findElement(WebDriverBy::id('password'))->sendKeys(\Tests\Base\A_User::$defaultPassrowd);
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Property \Tests\GuiBase->driver has undeclared type \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

        protected $driver;
    Severity: Minor
    Found in tests/GuiBase.php by phan

    Call to method findElement from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $this->driver->findElement(WebDriverBy::id('username'))->sendKeys('demo');
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method id from undeclared class \Facebook\WebDriver\WebDriverBy
    Open

            $this->driver->findElement(WebDriverBy::id('username'))->sendKeys('demo');
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Class extends undeclared class \PHPUnit\Framework\TestCase
    Open

    abstract class GuiBase extends TestCase
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method findElement from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $this->driver->findElement(WebDriverBy::id('password'))->sendKeys(\Tests\Base\A_User::$defaultPassrowd);
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method getCurrentURL from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

                'url' => $this->driver->getCurrentURL(),
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method chrome from undeclared class \Facebook\WebDriver\Remote\DesiredCapabilities
    Open

                $capabilities = DesiredCapabilities::chrome();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method findElement from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $this->driver->findElement(WebDriverBy::tagName('form'))->submit();
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Call to method get from undeclared class \Facebook\WebDriver\Remote\RemoteWebDriver
    Open

            $this->driver->get(\App\Config::main('site_URL') . $url);
    Severity: Critical
    Found in tests/GuiBase.php by phan

    Avoid variables with short names like $t. Configured minimum length is 3.
    Open

        protected function onNotSuccessfulTest(\Throwable $t): void
    Severity: Minor
    Found in tests/GuiBase.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected function onNotSuccessfulTest(\Throwable $t): void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

                $capabilities->setCapability('chromeOptions', ['args' => ['headless', 'disable-dev-shm-usage', 'no-sandbox']]);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function login(): void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public $logs;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected $driver;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $this->driver->getCurrentURL();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected function setUp(): void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!$this->isLogin) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (null !== $this->driver) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo PHP_EOL;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @throws \ReflectionException
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param \Throwable $t
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (isset($this->logs)) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                file_put_contents(ROOT_DIRECTORY . '/cache/logs/selenium_logs.log', print_r($this->logs, true));
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            print_r($t->__toString());
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo 'No $this->driver';
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $this->login();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Find error or exceptions.
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                file_put_contents(ROOT_DIRECTORY . '/cache/logs/selenium_source.html', $this->driver->getPageSource());
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo PHP_EOL;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (empty($this->driver)) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->driver->findElement(WebDriverBy::id('username'))->sendKeys('demo');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $source = $this->driver->getPageSource();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreEnd
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'test' => __METHOD__,
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'url' => $this->driver->getCurrentURL(),
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $url
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'test' => __METHOD__,
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function findError(): void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo 'Browser logs: ';
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                print_r($this->driver->manage()->getLog('browser'));
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            parent::setUp();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $capabilities->setCapability('chromeOptions', ['args' => ['headless', 'disable-dev-shm-usage', 'no-sandbox']]);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->logs = [
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                foreach ($browserLogs as $value) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreEnd
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Not success test.
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  LOGS:\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo 'URL: ';
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Setup test.
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Line exceeds 120 characters; contains 136 characters
    Open

                echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  LOGS:\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $this->driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities, 60000, 60000);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreStart
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if ('SEVERE' === $value['level']) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            throw $t;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->driver->get(\App\Config::main('site_URL') . 'index.php?module=Users&view=Login');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (false !== stripos($source, 'YetiForceError!!!')) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $browserLogs = $this->driver->manage()->getLog('browser');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->isLogin = true;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (false !== stripos($source, 'YetiError!!!')) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \Exception('An error has been found');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected $isLogin = false;
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            } else {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->driver->get(\App\Config::main('site_URL') . $url);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'getPageSource' => $this->driver->getPageSource(),
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreEnd
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            ];
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                \print_r($t);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                echo 'Title: ';
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $this->driver->getTitle();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Testing login page display.
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                /** @codeCoverageIgnoreStart */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $log = '';
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $log .= "[{$value['level']}] {$value['message']}\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var bool Is login */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            echo "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $this->driver->takeScreenshot(ROOT_DIRECTORY . '/cache/logs/selenium_screenshot.png');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Go to URL.
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function url(string $url): void
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'url' => $this->driver->getCurrentURL(),
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->driver->findElement(WebDriverBy::tagName('form'))->submit();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \Exception('Undefined variable found');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var \Facebook\WebDriver\Remote\RemoteWebDriver Web driver. */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                \print_r($this->logs);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            ];
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ($browserLogs) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->logs = [
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreStart
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if ($log) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'getPageSource' => $source,
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var mixed Last logs. */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @codeCoverageIgnore
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $capabilities = DesiredCapabilities::chrome();
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (false !== stripos($source, 'Undefined variable:')) {
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreEnd
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    throw new \Exception('A JavaScript error has occurred: ' . PHP_EOL . $log);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->driver->findElement(WebDriverBy::id('password'))->sendKeys(\Tests\Base\A_User::$defaultPassrowd);
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \Exception('An error has been found');
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                // @codeCoverageIgnoreStart
    Severity: Minor
    Found in tests/GuiBase.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status