Showing 143 of 143 total issues
Method inline
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
switch ($name) {
case'switch':
$source->on(self::EVENT_PRE_ENTER, function () use ($value) {
$this->macroOpenSwitch($this->delimite($value));
- Create a ticketCreate a ticket
Function parseComment
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseComment(IIterator $iterator) {
$type = self::XML_TYPE_COMMENT;
$close = false;
foreach ($iterator as $char) {
switch ($char) {
- 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 isDirty
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function isDirty($current, $value): bool {
if ($current === null && $value === null) {
return false;
} else if (($current === null && $value !== null) || ($current !== null && $value === null)) {
return true;
- 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 template
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function template($context = null, string $name = null) {
try {
/** @var $context ITemplateContext */
if ($context === 'this') {
$context = $this;
- 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 store
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function store(ICrate $crate): IStorage {
$this->driver->setup();
$schema = $crate->getSchema();
if ($schema->getMeta('storable', false) === false) {
throw new StorageException(sprintf('Crate [%s] is not marked as storable (in meta data).', $schema->getSchemaName()));
- 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 can
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function can(string $resource, \DateTime $dateTime = null, bool $default = null): bool {
if ($default === null && isset($this->aclList[$resource]) === false && isset($this->aclList[null]) === false) {
throw new AclException(sprintf('Asking for unknown resource [%s].', $resource));
}
$can = (bool)$default;
- 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 getPath
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getPath($attribute = false, $meta = false) {
$current = $this;
$path = [];
while ($current) {
$fragment = $current->getName();
- 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 getParameterList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getParameterList(\ReflectionClass $reflectionClass, \ReflectionMethod $reflectionMethod, string $method) {
$parameterList = [];
if (strlen($name = $reflectionMethod->getName()) > strlen($method) && strpos($name, $method, 0) === 0) {
if ($reflectionMethod->isPublic() === false) {
throw new ContainerException(sprintf('Method [%s::%s()] must be public.', $reflectionClass->getName(), $reflectionMethod->getName()));
- 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 formatCreateSchemaQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function formatCreateSchemaQuery(INode $node) {
$sql = 'CREATE TABLE IF NOT EXISTS ' . $this->delimite($node->getValue()) . ' (';
$columnList = [];
foreach ($this->createSchemaNodeQuery->filter($node) as $propertyNode) {
$column = $this->delimite($propertyNode->getName()) . ' ' . $this->type($propertyNode->getAttribute('type'));
- 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 __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(ISchema $schema, string $name, string $type = 'string', bool $required = true, bool $unique = false, bool $identifier = false, bool $array = false) {
- Create a ticketCreate a ticket
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($name, $value, $expire, $path, $domain, $secure = false, $httpOnly = false) {
- Create a ticketCreate a ticket
Method inline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
- Create a ticketCreate a ticket
Method inline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
- Create a ticketCreate a ticket
Function getAbsoluteUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getAbsoluteUrl(): string {
$scheme = $this->getScheme();
$url = '';
if ($scheme !== '') {
$url = $scheme . '://';
- 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 inline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
- Create a ticketCreate a ticket
Method inline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
- Create a ticketCreate a ticket
Function read
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function read(callable $handler = null): string {
/**
* stream must read the data or connection will stay forever
*/
$data = '';
- 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 inline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
- Create a ticketCreate a ticket
Method inline
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inline(IMacro $source, ICompiler $compiler, \Iterator $iterator, INode $node, string $name, $value = null) {
- Create a ticketCreate a ticket
Function copyDirectory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static public function copyDirectory(string $source, string $destination, callable $filter = null) {
$source = self::normalize($source);
$destination = self::normalize($destination);
/** @var $item \SplFileInfo */
foreach (new \RecursiveIteratorIterator($iterator = new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
- 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"