ernestwisniewski/kbin

View on GitHub

Showing 226 of 573 total issues

Method hydrate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function hydrate(PostComment ...$comment): void
    {
        $this->_em->createQueryBuilder()
            ->select('PARTIAL c.{id}')
            ->addSelect('u')
Severity: Minor
Found in src/Repository/PostCommentRepository.php - About 1 hr to fix

    Method buildForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function buildForm(FormBuilderInterface $builder, array $options): void
        {
            $builder
                ->add('query', TextType::class, [
                    'attr' => [
    Severity: Minor
    Found in src/Kbin/Magazine/Form/MagazinePageViewType.php - About 1 hr to fix

      Method __invoke has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          #[OA\Response(
              response: 200,
              description: 'Returns a paginated list of entries from a specific user',
              content: new OA\JsonContent(
                  type: 'object',
      Severity: Minor
      Found in src/Controller/Api/Entry/UserEntriesRetrieveApi.php - About 1 hr to fix

        Method __invoke has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            #[OA\Response(
                response: 200,
                description: 'Returns a paginated list of Entries',
                content: new OA\JsonContent(
                    type: 'object',
        Severity: Minor
        Found in src/Controller/Api/Entry/MagazineEntriesRetrieveApi.php - About 1 hr to fix

          Method __invoke has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              #[OA\Response(
                  response: 200,
                  description: 'Returns a paginated list of comments from a specific user',
                  content: new OA\JsonContent(
                      type: 'object',
          Severity: Minor
          Found in src/Controller/Api/Entry/Comments/UserEntryCommentsRetrieveApi.php - About 1 hr to fix

            Method subscribed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                #[OA\Response(
                    response: 200,
                    description: 'A paginated list of posts from user\'s subscribed magazines',
                    content: new OA\JsonContent(
                        type: 'object',
            Severity: Minor
            Found in src/Controller/Api/Post/PostsRetrieveApi.php - About 1 hr to fix

              Method __invoke has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  #[OA\Response(
                      response: 200,
                      description: 'A paginated list of posts from the user',
                      content: new OA\JsonContent(
                          type: 'object',
              Severity: Minor
              Found in src/Controller/Api/Post/UserPostsRetrieveApi.php - About 1 hr to fix

                Method __invoke has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    #[OA\Response(
                        response: 200,
                        description: 'Returns a paginated list of entries from a specific domain',
                        content: new OA\JsonContent(
                            type: 'object',
                Severity: Minor
                Found in src/Controller/Api/Entry/DomainEntriesRetrieveApi.php - About 1 hr to fix

                  Method favourited has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      #[OA\Response(
                          response: 200,
                          description: 'A paginated list of user\'s favourited posts',
                          content: new OA\JsonContent(
                              type: 'object',
                  Severity: Minor
                  Found in src/Controller/Api/Post/PostsRetrieveApi.php - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if ($parent instanceof Entry) {
                                    $children = array_filter(
                                        $comments,
                                        fn ($val) => $val instanceof EntryComment && $val->entry === $parent
                                    );
                    Severity: Major
                    Found in src/Kbin/SubjectOverviewListCreate.php - About 1 hr to fix

                      Method __invoke has 8 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 1 hr to fix

                        Function handleImages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function handleImages(array $attachment): ?Image
                            {
                                $images = array_filter(
                                    $attachment,
                                    fn ($val) => \in_array($val['type'], ['Document', 'Image']) && ImageManager::isImageUrl($val['url'])
                        Severity: Minor
                        Found in src/Service/ActivityPubManager.php - About 55 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 notification has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            notification(data) {
                                if (data.detail.parentSubject && this.element.id === data.detail.parentSubject.htmlId) {
                                    if (data.detail.op.endsWith('CommentDeletedNotification') || data.detail.op.endsWith('CommentCreatedNotification')) {
                                        this.updateCommentCounter(data);
                                    }
                        Severity: Minor
                        Found in assets/controllers/subject_controller.js - About 55 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 uploadImage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            #[OA\Response(
                                response: 201,
                                description: 'Returns the created oauth2 client. Be sure to save the identifier and secret since these will be how you obtain tokens for the API.',
                                content: new Model(type: OAuth2ClientDto::class, groups: ['Default', 'created', 'common']),
                                headers: [
                        Severity: Minor
                        Found in src/Controller/Api/OAuth2/CreateClientApi.php - About 55 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 __invoke has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            #[OA\Response(
                                response: 200,
                                description: 'Returns a paginated list of content, along with any ActivityPub actors that matched the query by username, or ActivityPub objects that matched the query by URL. Actors and objects are not paginated',
                                content: new OA\JsonContent(
                                    type: 'object',
                        Severity: Minor
                        Found in src/Controller/Api/Search/SearchRetrieveApi.php - About 55 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 __invoke has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            #[OA\Response(
                                response: 201,
                                description: 'Returns the created oauth2 client. Be sure to save the identifier and secret since these will be how you obtain tokens for the API.',
                                content: new Model(type: OAuth2ClientDto::class, groups: ['created', 'common']),
                                headers: [
                        Severity: Minor
                        Found in src/Controller/Api/OAuth2/CreateClientApi.php - About 55 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 serializeNotification has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function serializeNotification(Notification $dto)
                            {
                                $toReturn = [
                                    'notificationId' => $dto->getId(),
                                    'status' => $dto->status,
                        Severity: Minor
                        Found in src/Controller/Api/Notification/NotificationBaseApi.php - About 55 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 ban has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                #[MapEntity(id: 'magazine_id')]
                                Magazine $magazine,
                                #[MapEntity(id: 'user_id')]
                                User $user,
                                MagazineBan $magazineBan,
                        Severity: Major
                        Found in src/Controller/Api/Magazine/Moderate/MagazineUserBanApi.php - About 50 mins to fix

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

                              public static function create(int $id, string $filePath, int $width = null, int $height = null, string $altText = null, string $sourceUrl = null, string $storageUrl = null): self
                          Severity: Major
                          Found in src/DTO/ImageDto.php - About 50 mins to fix

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

                                    private string $route,
                                    private string $paramName,
                                    private string $slug,
                                    string $label,
                                    string $title,
                            Severity: Major
                            Found in src/Markdown/CommonMark/Node/RoutedMentionLink.php - About 50 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language