VSVverkeerskunde/gvq-api

View on GitHub

Showing 428 of 1,426 total issues

Method fromContestParticipation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function fromContestParticipation(
        ContestParticipation $contestParticipation
    ): ContestParticipationEntity {
        if ($contestParticipation->getAddress()) {
            $address = AddressEmbeddable::fromAddress(
Severity: Minor
Found in src/Contest/Repositories/Entities/ContestParticipationEntity.php - About 1 hr to fix

    Method add has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function add(Request $request): Response
        {
            $form = $this->createCompanyForm(null, $request->getLocale() == 'nl');
            $form->handleRequest($request);
    
    
    Severity: Minor
    Found in src/Company/Controllers/CompanyViewController.php - About 1 hr to fix

      Function remove has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          remove: function( owner, key ) {
              var i,
                  cache = owner[ this.expando ];
      
              if ( cache === undefined ) {
      Severity: Minor
      Found in public/js/jquery.js - About 1 hr to fix

        Function _transitionComplete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              _proto._transitionComplete = function _transitionComplete(element, active, callback) {
                if (active) {
                  $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
                  var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
        
        
        Severity: Minor
        Found in public/js/bootstrap.js - About 1 hr to fix

          Function compareObjects has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var compareObjects = function (objectA, objectB, compareLength) {
                  // Create arrays of property names
                  var getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
                      var arr = [];
                      for (var k in obj) {
          Severity: Minor
          Found in public/js/bootstrap-table.js - About 1 hr to fix

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

                public function __construct(
                    iterable $companies,
                    CompanyPlayedQuizzesRepository $companyPlayedQuizzesRepository,
                    EmployeeParticipationRepository $employeeParticipationRepository,
                    TopScoreRepository $topScoreRepository,
            Severity: Minor
            Found in src/Company/CompaniesCsvData.php - About 1 hr to fix

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

                  public function getParticipantsInTeam(UuidInterface $teamId): \Traversable
                  {
                      $batchSize = 10;
                      $firstResult = 0;
              
              
              Severity: Minor
              Found in src/Contest/Repositories/ContestParticipationDoctrineRepository.php - About 1 hr to fix

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

                    private function getValues(Company $company)
                    {
                        $data = $this->normalizer->normalize($company);
                
                        $values = [];
                Severity: Minor
                Found in src/Company/CompaniesCsvData.php - About 1 hr to fix

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

                      public function normalize($company, $format = null, array $context = array()): array
                      {
                          $aliases = array_map(
                              function (TranslatedAlias $translatedAlias) use ($format) {
                                  return $this->translatedAliasNormalizer->normalize(
                  Severity: Minor
                  Found in src/Company/Serializers/CompanyNormalizer.php - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if ( support.matchesSelector && documentIsHTML &&
                            !compilerCache[ expr + " " ] &&
                            ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                            ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
                    
                    
                    Severity: Major
                    Found in public/js/jquery.js - About 1 hr to fix

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

                              QuizService $quizService,
                              CompanyRepository $companyRepository,
                              PartnerRepository $partnerRepository,
                              TeamRepository $teamRepository,
                              AnswerRepository $answerRepository,
                      Severity: Major
                      Found in src/Quiz/Controllers/QuizController.php - About 1 hr to fix

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

                                string $id,
                                string $email,
                                string $lastName,
                                string $firstName,
                                string $role,
                        Severity: Major
                        Found in src/User/Repositories/Entities/UserEntity.php - About 1 hr to fix

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

                              public function contest(Request $request, string $quizId): Response
                              {
                                  try {
                                      $quiz = $this->quizRepository->getById(Uuid::fromString($quizId));
                          
                          
                          Severity: Minor
                          Found in src/Contest/Controllers/ContestViewController.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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
                          Severity: Major
                          Found in public/js/jquery.js - About 50 mins to fix

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

                                    StartedQuizRepository $startedQuizRepository,
                                    FinishedQuizRepository $finishedQuizRepository,
                                    PassedQuizRepository $passedQuizRepository,
                                    UniqueParticipantRepository $uniqueParticipantRepository,
                                    PartnerRepository $partnerRepository,
                            Severity: Major
                            Found in src/Statistics/Service/StatisticsService.php - About 50 mins to fix

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

                                      UuidInterface $id,
                                      Email $email,
                                      NotEmptyString $lastName,
                                      NotEmptyString $firstName,
                                      Role $role,
                              Severity: Major
                              Found in src/User/Models/User.php - About 50 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
                                                            cur += clazz + " ";
                                                        }
                                Severity: Major
                                Found in public/js/jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
                                                              cur = cur.replace( " " + clazz + " ", " " );
                                                          }
                                  Severity: Major
                                  Found in public/js/jquery.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if ( conv && s.throws ) {
                                                            response = conv( response );
                                                        } else {
                                                            try {
                                                                response = conv( response );
                                    Severity: Major
                                    Found in public/js/jquery.js - About 45 mins to fix

                                      Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                                      Severity: Minor
                                      Found in public/js/jquery.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language