razielsd/phpSelenide

View on GitHub

Showing 12 of 128 total issues

ElementsCollection has 39 functions (exceeds 20 allowed). Consider refactoring.
Open

class ElementsCollection implements Iterator, Countable, ArrayAccess
{
    const MODE_SINGLE_ELEMENT = 1;
    const MODE_COLLECTION_ELEMENT = 2;

Severity: Minor
Found in lib/Selenide/ElementsCollection.php - About 5 hrs to fix

    File ElementsCollection.php has 315 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Selenide;
    
    use ArrayAccess;
    Severity: Minor
    Found in lib/Selenide/ElementsCollection.php - About 3 hrs to fix

      Function match has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          public function match($collection, $isPositive = true){
              $result = [];
              if ($this instanceof Condition_Interface_ExpectedCollection) {
                  $expected = $this->matchCollection($collection);
                  $expected = $isPositive ? $expected : !$expected;
      Severity: Minor
      Found in lib/Selenide/Condition/Rule.php - About 3 hrs 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

      Function searchBySelectors has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function searchBySelectors(SelectorList $selectorList)
          {
              $this->selenide->getReport()
                  ->addRootEvent('Search element: ' . $selectorList->getLocator());
              $resultList = [];
      Severity: Minor
      Found in lib/Selenide/Driver.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 search has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function search($selectorList) {
              $timeout = $this->selenide->configuration()->timeout;
              $startTime = microtime(true);
              $searchTimeout = 1;
              $isFound = false;
      Severity: Minor
      Found in lib/Selenide/Driver.php - About 1 hr to fix

        Method asString has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function asString()
            {
                $locator = '';
                switch ($this->type) {
                    case self::TYPE_NAME:
        Severity: Minor
        Found in lib/Selenide/By.php - About 1 hr to fix

          Method getChildLocator has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getChildLocator()
              {
                  $locator = '';
                  switch ($this->type) {
                      case self::TYPE_NAME:
          Severity: Minor
          Found in lib/Selenide/By.php - About 1 hr to fix

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

                public function search($selectorList) {
                    $timeout = $this->selenide->configuration()->timeout;
                    $startTime = microtime(true);
                    $searchTimeout = 1;
                    $isFound = false;
            Severity: Minor
            Found in lib/Selenide/Driver.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 searchBySelectors has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function searchBySelectors(SelectorList $selectorList)
                {
                    $this->selenide->getReport()
                        ->addRootEvent('Search element: ' . $selectorList->getLocator());
                    $resultList = [];
            Severity: Minor
            Found in lib/Selenide/Driver.php - About 1 hr to fix

              Function escapeString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function escapeString(string $toEscape): string
                  {
                      if (mb_strpos($toEscape, '"') !== false && mb_strpos($toEscape, "'") !== false) {
                          $substringsWithoutDoubleQuotes = explode('"', $toEscape);
              
              
              Severity: Minor
              Found in lib/Selenide/By.php - About 55 mins 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

              Function getChildLocator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getChildLocator()
                  {
                      $locator = '';
                      switch ($this->type) {
                          case self::TYPE_NAME:
              Severity: Minor
              Found in lib/Selenide/By.php - About 55 mins 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

              Function asString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function asString()
                  {
                      $locator = '';
                      switch ($this->type) {
                          case self::TYPE_NAME:
              Severity: Minor
              Found in lib/Selenide/By.php - About 55 mins 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

              Severity
              Category
              Status
              Source
              Language