components-web-app/api-components-bundle

View on GitHub

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)
Severity: Minor
Found in src/Entity/Core/FileInfo.php - About 45 mins to fix

    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;
            }
    Severity: Minor
    Found in src/Security/UserChecker.php - About 45 mins to fix

    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)
    Severity: Minor
    Found in src/Entity/User/AbstractUser.php - About 45 mins to fix

      Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              ManagerRegistry $managerRegistry,
              IriConverterInterface $iriConverter,
              ?PropertyAccessorInterface $propertyAccessor = null,
              ?LoggerInterface $logger = null,
              ?array $properties = null,
      Severity: Minor
      Found in src/Filter/OrSearchFilter.php - About 45 mins to fix

        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
        Severity: Minor
        Found in src/Doctrine/Extension/ORM/PublishableExtension.php - About 45 mins to fix

          Method init has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  ManagerRegistry $registry,
                  TimestampedAttributeReader $timestampedAnnotationReader,
                  TimestampedDataPersister $timestampedDataPersister,
                  UserEventListener $userEventListener,
                  NormalizerInterface $normalizer,
          Severity: Minor
          Found in src/EventListener/Form/EntityPersistFormListener.php - About 45 mins to fix

            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
            Severity: Minor
            Found in src/Doctrine/Extension/ORM/RoutableExtension.php - About 35 mins to fix

              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 = []
              Severity: Minor
              Found in src/Annotation/UploadableField.php - About 35 mins to fix

                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)
                Severity: Minor
                Found in src/Model/Uploadable/UploadedDataUriFile.php - About 35 mins to fix

                  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
                  Severity: Minor
                  Found in src/Doctrine/Extension/ORM/PublishableExtension.php - About 35 mins to fix

                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            EntityManagerInterface $entityManager,
                            UserRepositoryInterface $userRepository,
                            PasswordHasherFactoryInterface $passwordHasherFactory,
                            UserDataProcessor $userDataProcessor,
                            UserEventListener $userEventListener
                    Severity: Minor
                    Found in src/Helper/User/EmailAddressManager.php - About 35 mins to fix

                      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)
                      Severity: Minor
                      Found in src/Annotation/Publishable.php - About 35 mins to fix

                        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
                        Severity: Minor
                        Found in src/Doctrine/Extension/ORM/RouteExtension.php - About 35 mins to fix

                          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function __construct(?string $securityStr, ResourceAccessCheckerInterface $resourceAccessChecker, Security $security, AbstractPageDataRepository $pageDataRepository, DenyAccessListener $denyAccessListener)
                          Severity: Minor
                          Found in src/Security/Voter/RoutableVoter.php - About 35 mins to fix

                            Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function __invoke(object $data, string $property, Request $request, UploadableAttributeReader $annotationReader, UploadableFileManager $uploadableFileManager)
                            Severity: Minor
                            Found in src/Action/Uploadable/DownloadAction.php - About 35 mins to fix

                              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
                              Severity: Minor
                              Found in src/Serializer/Normalizer/UploadableNormalizer.php - About 35 mins to fix

                                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();
                                Severity: Minor
                                Found in src/EventListener/Api/PublishableEventListener.php - About 35 mins to fix

                                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) {
                                Severity: Minor
                                Found in src/Repository/Core/FileInfoRepository.php - About 35 mins to fix

                                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);
                                
                                
                                Severity: Minor
                                Found in src/Helper/Uploadable/UploadableFileManager.php - About 35 mins to fix

                                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);
                                
                                
                                Severity: Minor
                                Found in src/Helper/Uploadable/UploadableFileManager.php - About 35 mins to fix

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language