VSVverkeerskunde/gvq-api

View on GitHub

Showing 428 of 1,426 total issues

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

        QuestionRepository $questionRepository,
        CategoryRepository $categoryRepository,
        QuizCompositionRepository $quizCompositionRepository,
        UuidFactoryInterface $uuidFactory,
        Year $year,
Severity: Minor
Found in src/Quiz/Service/QuizService.php - About 45 mins to fix

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

            UuidFactoryInterface $uuidFactory,
            Year $year,
            Language $language,
            QuizChannel $channel,
            Email $email,
    Severity: Minor
    Found in src/Contest/Forms/ContestFormType.php - About 45 mins to fix

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

              Swift_Mailer $swiftMailer,
              Twig_Environment $twig,
              TranslatorInterface $translator,
              UrlGeneratorInterface $urlGenerator,
              string $projectDir,
      Severity: Minor
      Found in src/Mail/Service/SwiftMailService.php - About 45 mins to fix

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

            public function login(Request $request): Response
            {
                $form = $this->createLoginForm();
                $form->handleRequest($request);
        
        
        Severity: Minor
        Found in src/Account/Controllers/AccountViewController.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 editContact has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function editContact(Request $request, ?string $id): Response
            {
                if ($id === null) {
                    $user = $this->userRepository->getByEmail(new Email($this->getUser()->getUsername()));
                } elseif ($this->get('security.authorization_checker')->isGranted('ROLE_CONTACT')) {
        Severity: Minor
        Found in src/User/Controllers/UserViewController.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

                UuidInterface $id,
                UrlSuffix $hashCode,
                User $user,
                \DateTimeImmutable $createdOn,
                bool $passwordReset,
        Severity: Minor
        Found in src/Registration/Models/Registration.php - About 45 mins to fix

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

                  string $uuid,
                  int $playhead,
                  string $payload,
                  string $metadata,
                  string $recordedOn,
          Severity: Minor
          Found in src/Quiz/EventStore/EventEntity.php - About 45 mins to fix

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

                    UuidInterface $id,
                    Year $year,
                    QuizChannel $channel,
                    Language $language,
                    NotEmptyString $question,
            Severity: Minor
            Found in src/Contest/Models/TieBreaker.php - About 45 mins to fix

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

                  public function getTraversableDomainMessages(
                      array $types = [],
                      int $firstId = null,
                      int $lastId = null,
                      callable $eventEntityFeedback = null,
              Severity: Minor
              Found in src/Quiz/EventStore/DoctrineEventStore.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

                      UuidFactoryInterface $uuidFactory,
                      UserRepository $userRepository,
                      CompanyRepository $companyRepository,
                      SerializerInterface $serializer,
                      TranslatorInterface $translator,
              Severity: Minor
              Found in src/Company/Controllers/CompanyViewController.php - About 45 mins to fix

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

                    private function guardChannel(QuizChannel $channel, ?Company $company, ?Partner $partner, ?Team $team): void
                    {
                        switch ($channel->toNative()) {
                            case QuizChannel::INDIVIDUAL:
                            case QuizChannel::LEAGUE:
                Severity: Minor
                Found in src/Quiz/Models/Quiz.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 bootstrap has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
                Severity: Minor
                Found in public/js/dataTables.bootstrap4.js - About 45 mins to fix

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

                          UuidInterface $id,
                          NotEmptyString $name,
                          PositiveNumber $numberOfEmployees,
                          TranslatedAliases $translatedAliases,
                          User $user,
                  Severity: Minor
                  Found in src/Company/Models/Company.php - About 45 mins to fix

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

                            string $id,
                            string $hashCode,
                            UserEntity $userEntity,
                            \DateTimeImmutable $createdOn,
                            bool $passwordReset,
                    Severity: Minor
                    Found in src/Registration/Repositories/Entities/RegistrationEntity.php - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if ( matcher[ expando ] ) {
                                      // Find the next relative operator (if any) for proper handling
                                      j = ++i;
                                      for ( ; j < len; j++ ) {
                                          if ( Expr.relative[ tokens[j].type ] ) {
                      Severity: Major
                      Found in public/js/jquery.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        if ( nCell.nodeName.toUpperCase() == "TD" ||
                                             nCell.nodeName.toUpperCase() == "TH" )
                                        {
                                            /* Get the col and rowspan attributes from the DOM and sanitise them */
                                            iColspan = nCell.getAttribute('colspan') * 1;
                        Severity: Major
                        Found in public/js/jquery.dataTables.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                                          context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
                          
                                      context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
                                      if ( !context ) {
                          Severity: Major
                          Found in public/js/jquery.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                      if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
                                        continue;
                                      }
                            Severity: Major
                            Found in public/js/bootstrap.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
                                    throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
                                  }
                              Severity: Major
                              Found in public/js/bootstrap.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
                                          if (event.which === ESCAPE_KEYCODE) {
                                            var toggle = $$$1(parent).find(Selector.DATA_TOGGLE)[0];
                                            $$$1(toggle).trigger('focus');
                                          }
                                Severity: Major
                                Found in public/js/bootstrap.js - About 40 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language