VSVverkeerskunde/gvq-api

View on GitHub

Showing 1,426 of 1,426 total issues

Avoid deeply nested control flow statements.
Open

                        if ( cellData === null ) {
                            cellData = '';
                        }
Severity: Major
Found in public/js/jquery.dataTables.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for ( j=0, jen=items.length ; j<jen ; j++ ) {
                            item = items[j];
        
                            if ( type === 'cell' ) {
                                ret = fn.call( apiInst, context[i], item.row, item.column, i, j );
    Severity: Major
    Found in public/js/jquery.dataTables.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( ! detectedType && j !== types.length-1 ) {
                                  break;
                              }
      Severity: Major
      Found in public/js/jquery.dataTables.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ( type === 'column-rows' ) {
                                rows = _selector_row_indexes( context[i], selector.opts );
                            }
        Severity: Major
        Found in public/js/jquery.dataTables.js - About 45 mins to fix

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

              private function getTieBreakerByLocaleAndChannel(string $locale, QuizChannel $channel): array
              {
                  if (!$channel->equals(new QuizChannel(QuizChannel::LEAGUE))) {
                      $channel = new QuizChannel(QuizChannel::INDIVIDUAL);
                  }
          Severity: Minor
          Found in src/Contest/Controllers/ContestViewController.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 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

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

                  string $id,
                  string $name,
                  int $numberOfEmployees,
                  Collection $translatedAliasEntities,
                  UserEntity $user,
          Severity: Minor
          Found in src/Company/Repositories/Entities/CompanyEntity.php - About 45 mins to fix

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

                    QuizChannel $quizChannel,
                    ?Alias $companyAlias,
                    ?Alias $partnerAlias,
                    ?UuidInterface $teamId,
                    Language $language,
            Severity: Minor
            Found in src/Quiz/Commands/StartQuiz.php - About 45 mins to fix

              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,
                        Year $year,
                        QuizChannel $channel,
                        Language $language,
                        NotEmptyString $question,
                Severity: Minor
                Found in src/Contest/Models/TieBreaker.php - About 45 mins to fix

                  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 __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,
                              NotEmptyString $name,
                              PositiveNumber $numberOfEmployees,
                              TranslatedAliases $translatedAliases,
                              User $user,
                      Severity: Minor
                      Found in src/Company/Models/Company.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

                            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 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 generateQuiz has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      QuizChannel $channel,
                                      ?Company $company,
                                      ?Partner $partner,
                                      ?Team $team,
                                      Language $language,
                              Severity: Minor
                              Found in src/Quiz/Service/QuizService.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

                                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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language