Showing 44 of 129 total issues
Request
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
class Request extends Prototype implements RequestInterface
{
use DebugDescriptionTrait;
protected const
Where
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Where extends Prototype implements WhereInterface
{
use DebugDescriptionTrait;
protected const
Function configureWithOptions
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
protected function configureWithOptions(array $options): self
{
foreach ($options as $name => $value) {
if (isset(static::THIS_SETS[$name])) {
$types = (array) static::THIS_SETS[$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
Repository
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Repository extends Resource implements RepositoryInterface
{
protected const
ENTITY_ID_PROTOTYPE = '*\Model\Entity\EntityId',
ENTITY_REFRESH_FAILURE_EXCEPTION = 'Entity refresh error',
File Request.php
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Fixin Framework
*
* Copyright (c) Attila Jenei
File Where.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Fixin Framework
*
* Copyright (c) Attila Jenei
Function produceResource
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function produceResource(string $key, array $options, string $name)
{
if (isset($this->definitions[$key])) {
$definition = $this->definitions[$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"
Further reading
Function autoloadCallback
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function autoloadCallback(string $class): void
{
// Swap '\'
$class = strtr($class, '\\', DIRECTORY_SEPARATOR);
- 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 configureWithOptions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configureWithOptions(array $options): self
{
foreach ($options as $name => $value) {
if (isset(static::THIS_SETS[$name])) {
$types = (array) static::THIS_SETS[$name];
Function getContentOptions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getContentOptions(ResourceManagerInterface $resourceManager, string $contentType): array
{
$contentType = strstr($contentType, ';', true);
if (in_array($contentType, static::FORM_MIME_TYPES)) {
- 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 produce
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function produce(string $key, array $options, string $name)
{
// CamelCase tags
$length = strlen($key);
$index = $this->keyPrefixLength;
Method addCompare
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addCompare(string $join, bool $positive, $left, string $operator, $right, string $leftType, string $rightType): void
Method addJoin
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addJoin(string $type, RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): void
Method processFiles
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function processFiles(ResourceManagerInterface $resourceManager, $name, $type, $tempFilename, $error, $size): ?array
Method addRouteParameterSegment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addRouteParameterSegment(string $name, array $segments, array $path, string $uri, array $parameters, int $level): void
Method compare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function compare($left, string $operator, $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE): WhereInterface;
Method addRouteSegments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addRouteSegments(array $segments, array $path, string $uri, array $parameters, int $level): void
Method join
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function join(RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): RequestInterface;
Method leftJoin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function leftJoin(RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): RequestInterface;
Method orCompare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function orCompare($left, string $operator, $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE): WhereInterface