ernestwisniewski/kbin

View on GitHub

Showing 226 of 573 total issues

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

        string $name,
        string $title,
        User $user,
        ?string $description,
        ?string $rules,
Severity: Major
Found in src/Entity/Magazine.php - About 50 mins to fix

    Method uploadImage has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            ClientManagerInterface $manager,
            ClientFactory $clientFactory,
            UserCreate $userCreate,
            UserRepository $userRepository,
            SettingsManager $settingsManager,
    Severity: Major
    Found in src/Controller/Api/OAuth2/CreateClientApi.php - About 50 mins to fix

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

              string $fileName,
              string $filePath,
              string $sha256,
              ?int $width,
              ?int $height,
      Severity: Minor
      Found in src/Entity/Image.php - About 45 mins to fix

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

                #[MapEntity(id: 'magazine_id')]
                Magazine $magazine,
                EntryBadgeCreate $entryBadgeCreate,
                MagazineFactory $factory,
                SerializerInterface $serializer,
        Severity: Minor
        Found in src/Controller/Api/Magazine/Admin/MagazineAddBadgesApi.php - About 45 mins to fix

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

                  #[MapEntity(id: 'magazine_id')]
                  Magazine $magazine,
                  MagazineThemeChange $magazineThemeChange,
                  MagazineFactory $magazineFactory,
                  ImageFactory $imageFactory,
          Severity: Minor
          Found in src/Controller/Api/Magazine/Admin/MagazineUpdateThemeApi.php - About 45 mins to fix

            Function getMonthlyStats has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getMonthlyStats(): array
                {
                    $conn = $this->getEntityManager()
                        ->getConnection();
            
            
            Severity: Minor
            Found in src/Repository/StatsViewsRepository.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

            Function updateUser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateUser(string $actorUrl): User
                {
                    $user = $this->userRepository->findOneBy(['apProfileId' => $actorUrl]);
            
                    $actor = $this->apHttpClient->getActorObject($actorUrl);
            Severity: Minor
            Found in src/Service/ActivityPubManager.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 create has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static function create(UserSmallResponseDto $sender, string $body, string $status, int $threadId, \DateTimeImmutable $createdAt, int $messageId): self
            Severity: Minor
            Found in src/DTO/MessageResponseDto.php - About 45 mins to fix

              Function setDimensions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function setDimensions(?int $width, ?int $height): void
                  {
                      if (null !== $width && $width <= 0) {
                          throw new \InvalidArgumentException('$width must be NULL or >0');
                      }
              Severity: Minor
              Found in src/Entity/Image.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 create has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function create(int $consentId, string $clientName, ?string $clientDescription, ?ImageDto $logo, array $scopesGranted, array $scopesAvailable): self
              Severity: Minor
              Found in src/DTO/ClientConsentsResponseDto.php - About 45 mins to fix

                Function findOrCreateFromPath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function findOrCreateFromPath(string $source): ?Image
                    {
                        $fileName = $this->imageManager->getFileName($source);
                        $filePath = $this->imageManager->getFilePath($source);
                        $sha256 = hash_file('sha256', $source, true);
                Severity: Minor
                Found in src/Repository/ImageRepository.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 __invoke has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        #[MapEntity(id: 'magazine_id')]
                        Magazine $magazine,
                        MagazineEdit $magazineEdit,
                        MagazineFactory $magazineFactory,
                        ValidatorInterface $validator,
                Severity: Minor
                Found in src/Controller/Api/Magazine/Admin/MagazineUpdateApi.php - About 45 mins to fix

                  Function __invoke has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function __invoke(
                          #[MapEntity(mapping: ['magazine_name' => 'name'])]
                          Magazine $magazine,
                          #[MapEntity(id: 'entry_id')]
                          Entry $entry,
                  Severity: Minor
                  Found in src/Controller/Entry/EntrySingleController.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 __invoke has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          #[MapEntity(id: 'post_id')]
                          Post $post,
                          PostEdit $postEdit,
                          PostFactory $postFactory,
                          ValidatorInterface $validator,
                  Severity: Minor
                  Found in src/Controller/Api/Post/PostsUpdateApi.php - About 45 mins to fix

                    Function __invoke has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __invoke(
                            #[MapEntity(mapping: ['magazine_name' => 'name'])]
                            Magazine $magazine,
                            #[MapEntity(id: 'post_id')]
                            Post $post,
                    Severity: Minor
                    Found in src/Controller/Post/PostSingleController.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 __invoke has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            #[MapEntity(id: 'post_id')]
                            Post $post,
                            #[MapEntity(id: 'comment_id')]
                            ?PostComment $parent,
                            PostCommentCreate $postCommentCreate,
                    Severity: Minor
                    Found in src/Controller/Api/Post/Comments/PostCommentsCreateApi.php - About 45 mins to fix

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

                              #[MapEntity(id: 'entry_id')]
                              Entry $entry,
                              #[MapEntity(id: 'comment_id')]
                              ?EntryComment $parent,
                              EntryCommentCreate $entryCommentCreate,
                      Severity: Minor
                      Found in src/Controller/Api/Entry/Comments/EntryCommentsCreateApi.php - About 45 mins to fix

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

                                #[MapEntity(id: 'user_id')]
                                User $user,
                                EntryRepository $repository,
                                EntryFactory $factory,
                                RequestStack $request,
                        Severity: Minor
                        Found in src/Controller/Api/Entry/UserEntriesRetrieveApi.php - About 45 mins to fix

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

                                  #[MapEntity(id: 'entry_id')]
                                  Entry $entry,
                                  #[MapEntity(id: 'comment_id')]
                                  ?EntryComment $parent,
                                  EntryCommentCreate $entryCommentCreate,
                          Severity: Minor
                          Found in src/Controller/Api/Entry/Comments/EntryCommentsCreateApi.php - About 45 mins to fix

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

                                    #[MapEntity(id: 'magazine_id')]
                                    Magazine $magazine,
                                    EntryRepository $repository,
                                    EntryFactory $factory,
                                    RequestStack $request,
                            Severity: Minor
                            Found in src/Controller/Api/Entry/MagazineEntriesRetrieveApi.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language