Showing 42 of 53 total issues
Function removeAllAssociations
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
protected function removeAllAssociations(EntityInterface $entity)
{
$required = $entity::getDoctrineStaticMeta()->getRequiredRelationProperties();
$meta = $this->getTestedEntityClassMetaData();
$identifiers = array_flip($meta->getIdentifier());
- 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 initialiseProperties
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
private function initialiseProperties(EntityInterface $entity): void
{
$getters = $entity::getDoctrineStaticMeta()->getGetters();
foreach ($getters as $getter) {
try {
- 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 replaceNestedDtosWithNewEntities
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
private function replaceNestedDtosWithNewEntities(DataTransferObjectInterface $dto): void
{
$getters = $this->getGettersForDtosOrCollections($dto);
if ([[], []] === $getters) {
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
Function addNestedRequiredDtos
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
private function addNestedRequiredDtos(DataTransferObjectInterface $dto): void
{
$entityFqn = $dto::getEntityFqn();
$dsm = $this->getDsmFromEntityFqn($entityFqn);
$requiredRelations = $dsm->getRequiredRelationProperties();
- 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 checkFakerClassesRootNamespaceMatchesEntityFqn
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
private function checkFakerClassesRootNamespaceMatchesEntityFqn(string $fakedEntityFqn): void
{
if ([] === $this->fakerDataProviderClasses) {
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
Avoid too many return
statements within this method. Open
return $this->getBigInt();
Avoid too many return
statements within this method. Open
return $this->getText();
Avoid too many return
statements within this method. Open
return self::HAS_REQUIRED_MANY_TO_ONE;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return "4 $commentStart Fields $commentEnd";
Avoid too many return
statements within this method. Open
return (string)$this->defaultValue;
Avoid too many return
statements within this method. Open
return 'null';
Avoid too many return
statements within this method. Open
return $this->getFloat();
Avoid too many return
statements within this method. Open
return "3 $commentStart DSM Fields $commentEnd";
Avoid too many return
statements within this method. Open
return self::HAS_MANY_TO_ONE;
Avoid too many return
statements within this method. Open
return $this->getDateTimeImmutable();
Avoid too many return
statements within this method. Open
return $this->getString($fieldName, $class);
Function getTypesFromVarComment
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
private function getTypesFromVarComment(string $property, string $filename): array
{
$docComment = $this->reflectionClass->getProperty($property)->getDocComment();
preg_match('%@var\s*?(.+)%', $docComment, $matches);
$traitCode = \ts\file_get_contents($filename);
- 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 unserialiseUuids
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
private function unserialiseUuids(array &$query, UuidFactory $factory): void
{
if (null === $query['params']) {
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
Function getErrorsSummary
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
private static function getErrorsSummary(
ConstraintViolationListInterface $errors,
string $className,
EntityData $dataObject
): string {
- 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"