Showing 7 of 7 total issues
Locator
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
final class Locator implements \ArrayAccess, \Countable, \Iterator
{
/** @var string */
private $defaultChannel;
/** @var ComponentFactory */
Function end
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function end(...$args)
{
try {
return ($this->wrapped)(...$args);
} catch (\Throwable $e) {
- 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 merge
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function merge(array ...$args): array
{
\assert('count($args) > 0');
$res = array_shift($args);
foreach ($args as $next) {
- 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 softParse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $xml,
string $className = null,
int $options = null,
string $ns = null,
bool $isPrefix = null
Method parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $xml,
string $className = null,
int $options = null,
string $ns = null,
bool $isPrefix = null
Function getFilteredClasses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
final protected function getFilteredClasses(): \Generator
{
foreach ($this->getClasses() as $class) {
if (!$this->isFiltered($class)) {
$signal = yield $class;
- 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 findByPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function findByPath(string $path, array $scope)
{
if (mb_strpos($path, ':')) {
foreach (explode(':', $path) as $i => $key) {
if (!isset($scope[$key])) {
- 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"