Showing 127 of 143 total issues
Function createFactoryList
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
static public function createFactoryList(array $factoryList): array {
$factories = [];
foreach ($factoryList as $name => $factory) {
$current = null;
if ($factory instanceof \stdClass) {
- Read upRead up
- Create a ticketCreate a ticket
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 toNode
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
static public function toNode(\stdClass $stdClass, INode $node = null, string $class = null): INode {
$createNode = function (string $class, string $name = null): INode {
/** @var $node INode */
if (($node = new $class()) instanceof INode === false) {
throw new ClassMismatchException(sprintf('Class specified [%s] is not instance of [%s].', $class, INode::class));
- Read upRead up
- Create a ticketCreate a ticket
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 getArgumentList
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
static public function getArgumentList(array $argv) {
$argumentList = [];
/** @noinspection ForeachInvariantsInspection */
for ($i = 0, $j = count($argv); $i < $j; $i++) {
$arg = $argv[$i];
- Read upRead up
- Create a ticketCreate a ticket
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
File ContainerFactory.php
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Edde\Ext\Container;
- Create a ticketCreate a ticket
Function node
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
static public function node(INode $root, $source): INode {
$callback = null;
if (is_array($source) === false && is_object($source) === false) {
throw new NodeException('Source must be array or stdClass object.');
}
- Read upRead up
- Create a ticketCreate a ticket
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 compile
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function compile(IResourceList $resourceList = null): IFile {
$content = [];
$pathList = [];
$resourceList = $resourceList ?: $this;
$cache = $this->cache();
- Read upRead up
- Create a ticketCreate a ticket
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
AbstractStaticQueryFactory
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractStaticQueryFactory extends Object implements IStaticQueryFactory {
use ConfigurableTrait;
/**
* @var array
*/
- Create a ticketCreate a ticket
Function createHeaderList
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
static public function createHeaderList(): IHeaderList {
if (self::$headerList) {
return self::$headerList;
}
$headers = [];
- Read upRead up
- Create a ticketCreate a ticket
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 parseTag
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
protected function parseTag(IIterator $iterator, IXmlHandler $xmlHandler) {
$last = null;
$name = '';
$attributeList = [];
$type = self::XML_TYPE_WARP;
- Read upRead up
- Create a ticketCreate a ticket
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 getDefaultFactoryList
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function getDefaultFactoryList(): array {
return [
IContainer::class => Container::class,
IRootDirectory::class => self::exception(sprintf('Root directory is not specified; please register [%s] interface.', IRootDirectory::class)),
ITempDirectory::class => self::proxy(IRootDirectory::class, 'directory', [
- Create a ticketCreate a ticket
Url
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Url extends Object implements IUrl {
/**
* @var string
*/
protected $scheme = '';
- Create a ticketCreate a ticket
Method execute
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(): IResponse {
if ($this->curl === null) {
throw new ClientException(sprintf('Cannot execute handler for the url [%s] more than once.', (string)$this->request->getRequestUrl()));
}
$options = [];
- Create a ticketCreate a ticket
File
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class File extends Resource implements IFile {
/**
* @var IDirectory
*/
protected $directory;
- Create a ticketCreate a ticket
Function delete
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
static public function delete($path) {
for ($i = 0; $i < 3; $i++) {
try {
if (is_file($path) || is_link($path)) {
$func = DIRECTORY_SEPARATOR === '\\' && is_dir($path) ? 'rmdir' : 'unlink';
- Read upRead up
- Create a ticketCreate a ticket
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
StringUtils
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class StringUtils extends Object {
private static $SEPARATOR_LIST = [
'|',
':',
'.',
- Create a ticketCreate a ticket
Crate
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Crate extends Object implements ICrate {
/**
* @var ISchema
*/
protected $schema;
- Create a ticketCreate a ticket
AbstractNode
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractNode extends Object implements IAbstractNode {
/**
* @var IAbstractNode
*/
protected $parent;
- Create a ticketCreate a ticket
Method parseTag
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseTag(IIterator $iterator, IXmlHandler $xmlHandler) {
$last = null;
$name = '';
$attributeList = [];
$type = self::XML_TYPE_WARP;
- Create a ticketCreate a ticket
Function node
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function node(INode $node, \Iterator $iterator, ...$parameters) {
$level = $node->getLevel();
$stack = new \SplStack();
/**
* @var $levelTreeTraversal ITreeTraversal
- Read upRead up
- Create a ticketCreate a ticket
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 parse
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function parse($query) {
$query = str_replace('//', '/*/', $query);
$query = '/' . trim($query, '/') . '/';
$filter = new \stdClass();
$filter->fixed = strpos($query, '**') === false && strpos($query, '?*') === false;
- Read upRead up
- Create a ticketCreate a ticket
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"