File BelongsToMany.php
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Finesse\Wired\Relations;
use Finesse\MiniDB\Database;
Method attach
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function attach(
Mapper $mapper,
array $parents,
array $children,
string $onMatch,
Function updateAttachmentsGroup
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function updateAttachmentsGroup(
$parentId,
$childId,
array $parents,
array $children,
- 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 attach
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function attach(
Mapper $mapper,
array $parents,
array $children,
string $onMatch,
- 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 updateAttachmentsGroup
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateAttachmentsGroup(
$parentId,
$childId,
array $parents,
array $children,
Method loadRelatives
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadRelatives(Mapper $mapper, string $name, array $parents, \Closure $constraint = null)
{
if (!$parents) {
return;
}
Function loadRelatives
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function loadRelatives(Mapper $mapper, string $name, array $parents, \Closure $constraint = null)
{
if (!$parents) {
return;
}
- 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 updateAttachmentsGroup
has 7 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
$parentId,
$childId,
array $parents,
array $children,
array $oldAttachments,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $modelClass,
string $pivotParentField,
string $pivotTable,
string $pivotChildField,
string $parentIdentifierField = null,
Method makeAttachmentExtraFields
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ModelInterface $parent,
ModelInterface $child,
$parentKey,
$childKey,
callable $extraFieldsMaker = null,
Method attach
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Mapper $mapper,
array $parents,
array $children,
string $onMatch,
bool $detachOther,