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;
File ElementsCollection.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Selenide;
use ArrayAccess;
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;
- Read upRead up
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 = [];
- Read upRead up
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;
Method asString
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function asString()
{
$locator = '';
switch ($this->type) {
case self::TYPE_NAME:
Method getChildLocator
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getChildLocator()
{
$locator = '';
switch ($this->type) {
case self::TYPE_NAME:
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;
- Read upRead up
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 = [];
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);
- Read upRead up
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:
- Read upRead up
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:
- Read upRead up
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"