Showing 100 of 108 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $path, string $mimeType, int $fileSize, ?int $width, ?int $height, ?string $filter = null)
Function checkPreAuth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function checkPreAuth(UserInterface $user): void
{
if (!$user instanceof AbstractUser) {
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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $username = '', string $emailAddress = '', bool $emailAddressVerified = false, array $roles = ['ROLE_USER'], string $password = '', bool $enabled = true)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ManagerRegistry $managerRegistry,
IriConverterInterface $iriConverter,
?PropertyAccessorInterface $propertyAccessor = null,
?LoggerInterface $logger = null,
?array $properties = null,
Method applyToItem
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, ?Operation $operation = null, array $context = []): void
Method init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ManagerRegistry $registry,
TimestampedAttributeReader $timestampedAnnotationReader,
TimestampedDataPersister $timestampedDataPersister,
UserEventListener $userEventListener,
NormalizerInterface $normalizer,
Method applyToCollection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public string $adapter,
public string $urlGenerator = 'api',
public string $property = 'filename',
public ?string $prefix = null,
public ?array $imagineFilters = []
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(DataUriFile $file, ?string $originalName = null, ?string $mimeType = null, ?int $error = null, bool $test = false)
Method applyToCollection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityManagerInterface $entityManager,
UserRepositoryInterface $userRepository,
PasswordHasherFactoryInterface $passwordHasherFactory,
UserDataProcessor $userDataProcessor,
UserEventListener $userEventListener
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $fieldName = 'publishedAt', ?string $isGranted = null, string $associationName = 'publishedResource', string $reverseAssociationName = 'draftResource', ?array $validationGroups = null)
Method applyToCollection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(?string $securityStr, ResourceAccessCheckerInterface $resourceAccessChecker, Security $security, AbstractPageDataRepository $pageDataRepository, DenyAccessListener $denyAccessListener)
Method __invoke
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __invoke(object $data, string $property, Request $request, UploadableAttributeReader $annotationReader, UploadableFileManager $uploadableFileManager)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private MediaObjectFactory $mediaObjectFactory,
private UploadableAttributeReader $annotationReader,
private UploadableFileManager $uploadableFileManager,
ManagerRegistry $registry,
private ResourceMetadataProvider $resourceMetadataProvider
Function mergeDraftIntoPublished
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function mergeDraftIntoPublished(string $identifierFieldName, object $draftResource, object $publishedResource, bool $flushDatabase): void
{
$draftReflection = new \ReflectionClass($draftResource);
$publishedReflection = new \ReflectionClass($publishedResource);
$properties = $publishedReflection->getProperties();
- 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 getFilterQueries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getFilterQueries(?array $filters, Expr $expr, QueryBuilder $queryBuilder): array
{
$filterQueries = [];
if (null !== $filters) {
foreach ($filters as $filterIndex => $filter) {
- 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 storeFilesMetadata
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function storeFilesMetadata(object $object): void
{
$configuredProperties = $this->annotationReader->getConfiguredProperties($object, true);
$classMetadata = $this->getClassMetadata($object);
- 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 persistFiles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function persistFiles(object $object): void
{
$propertyAccessor = PropertyAccess::createPropertyAccessor();
$classMetadata = $this->getClassMetadata($object);
- 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"