Showing 12 of 12 total issues
Function importArray
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function importArray(array $data, array $included=null): void
{
if (array_key_exists('meta', $data)) {
$this->meta->importArray($data['meta']);
}
- 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 addIncluded
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function addIncluded(ResourceObject $resource, string $parentInclude='', array $includedResourceTypes=null, bool $isPrimaryData=false) : void
{
if (!$isPrimaryData) {
$includedResourceFound = 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
Function prepare
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function prepare(): array
{
foreach ($this->resources as $resource) {
$this->addIncluded($resource, '', $this->includedResourceTypes, true);
}
- 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 importArray
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function importArray(array $data, array $included=null): void
{
if (array_key_exists('type', $data)){
$this->type = $data['type'];
} else {
- 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 importArray
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function importArray(array $data, array $included=null): void
{
if (array_key_exists('included', $data)){
$included = $data['included'];
}
- 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 importArray
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importArray(array $data, array $included=null): void
{
if (array_key_exists('meta', $data)) {
$this->meta->importArray($data['meta']);
}
Method prepare
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepare(): array
{
foreach ($this->resources as $resource) {
$this->addIncluded($resource, '', $this->includedResourceTypes, true);
}
Method importArray
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importArray(array $data, array $included=null): void
{
if (array_key_exists('type', $data)){
$this->type = $data['type'];
} else {
Method importArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importArray(array $data, array $included=null): void
{
if (array_key_exists('included', $data)){
$included = $data['included'];
}
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Exception|Error|null $e=null,
?string $httpStatusCode=null,
?string $detail=null,
?string $id=null,
?string $errorUniqueCode=null,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(?string $type=null, ?string $id = null, ?array $dataImport=null, array $included=null, ?Meta $resourceIdentifierMeta=null)
Function __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
Exception|Error|null $e=null,
?string $httpStatusCode=null,
?string $detail=null,
?string $id=null,
- 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"